working recursive methods
[feisty_meow.git] / scripts / customize / fred / scripts / update_soapbox.sh
index 90a0e0b0aa18107c2b9ddfa63335f9730749dd87..f2208f5327b513714a0587fb213d6f2a2c288ef2 100644 (file)
@@ -3,63 +3,33 @@
 # updates my little 1 TB "soapbox" style usb drive with items that it should contain.
 
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+source "$FEISTY_MEOW_SCRIPTS/archival/shared_updater_parts.sh"
 
-function get_source()
-{
-  folder="$1"; shift
-  echo getting latest codes in $folder...
-  pushd "$folder"
-  if [ $? -ne 0 ]; then
-    echo Changing to the folder $folder failed.
-    exit 1
-  fi
-  bash "$FEISTY_MEOW_SCRIPTS/rev_control/rev_checkin.sh"
-  if [ $? -ne 0 ]; then
-    echo Checking out the latest codes has failed somehow for $folder.
-    exit 1
-  fi
-  popd
-}
+# where we're backing up to.
+TARGET_FOLDER="/media/fred/soapboxdrive"
 
 sep
 
-ls /media/fred/soapboxdrive
+echo Target drive currently has...
+ls "$TARGET_FOLDER"
 if [ $? -ne 0 ]; then
-  echo The soapbox drive is not mounted currently, so cannot be updated.
+  echo "The target location '$TARGET_FOLDER' is not mounted currently, so cannot be updated."
   exit 1
 fi
 
-sep
-
-echo synching walrus...
-rsync -av /z/walrus/* /media/fred/soapboxdrive/walrus/
-if [ $? -ne 0 ]; then
-  echo The walrus sync failed.
-  exit 1
-fi
-
-sep
-
-echo synching musix...
-rsync -av /z/musix/* /media/fred/soapboxdrive/musix/
-if [ $? -ne 0 ]; then
-  echo The musix sync failed.
-  exit 1
-fi
-
-sep
-
-echo getting latest fred codes...
-pushd /media/fred/soapboxdrive
-get_source extra_brain
+# synch all our targets.
+for currdir in $ARCHIVE_COLLECTIONS_LIST; do
+  synch_directory_to_target "$currdir" "$TARGET_FOLDER/$(basename $currdir)"/
+done
 
 sep
 
-echo getting latest gffs codes...
-get_source gffs
-popd
+# update source code if present.
+echo getting latest fred repositories...
+pushd "$TARGET_FOLDER"
+update_source_folders extra_brain
 
 sep
 
-echo Updated all portions of the soapbox drive successfully.
+echo Updated all expected portions of the targets successfully.