made a general comparator for my archives
authorChris Koeritz <fred@gruntose.com>
Thu, 18 Oct 2018 17:07:43 +0000 (13:07 -0400)
committerChris Koeritz <fred@gruntose.com>
Thu, 18 Oct 2018 17:07:43 +0000 (13:07 -0400)
not completely general yet, since archives list is encoded in script, but a lot nicer and closer to what i want for any machine.

scripts/archival/comparator.sh [new file with mode: 0644]
scripts/archival/general_updater.sh
scripts/customize/fred/scripts/archival/euphrosyne_comparator.sh

diff --git a/scripts/archival/comparator.sh b/scripts/archival/comparator.sh
new file mode 100644 (file)
index 0000000..236cc2c
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# compares this machine's local archives against an exemplar set.
+
+target="$1"; shift
+
+if [ -z "$target" ]; then
+  target=wildmutt
+  #target=curie
+fi
+
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+source "$FEISTY_MEOW_SCRIPTS/archival/general_updater.sh"
+
+uber_archive_comparator $target
+
index 084e26c318c0ae756d823bdda0f88d1069d76cac..7dac5777b1291eacc5b77109fd57a1d2619ce2a0 100644 (file)
@@ -98,6 +98,52 @@ function update_archive_drive()
   popd
 }
 
+# compares one local well-known folder against the similar folder on a
+# remote destination.
+function do_a_folder_compare()
+{
+  local archname="$1"; shift
+  local dest="$1"; shift
+  if [ -z "$archname" -o -z "$dest" ]; then
+    echo "do_a_folder_compare needs an archive name and a destination host."
+    return 1
+  fi
+
+  if [ -d "/z/$archname" ]; then
+    sep 14
+    echo "Comparing $archname folder..."
+    compare_dirs /z/${archname} ${dest}:/z/${archname}
+    sep 14
+  fi
+}
+
+# runs through all the local archives on this host to make sure nothing is
+# different when compared with the mainline versions on the specified host.
+function uber_archive_comparator()
+{
+  local target="$1"; shift
+  if [ -z "$target" ]; then
+    echo uber_archive_comparator needs the target host to compare with.
+    return 1
+  fi
+
+  sep 14
+  echo "comparing against host '$target'"
+  sep 14
+
+#hmmm: shouldn't this be a list in a variable someplace?
+  for archicle in \
+    basement \
+    imaginations \
+    musix \
+    toaster \
+    walrus \
+    ; do
+      do_a_folder_compare $archicle $target
+  done
+}
+
+
 #hmmm: abstractable piece?  the runtime plug at the end of a library script?
 # this block should execute when the script is actually run, rather
 # than when it's just being sourced.
index 4433e0e2a9c0da4111435b7ee59d8b52f8a3b57c..32980c427f72e3315a9e0d0d6d0e80864293e434 100644 (file)
@@ -1,58 +1,6 @@
 #!/bin/bash
 
-# runs through all the local archives on this host to make sure nothing is
-# different when compared with the mainline versions on the specified host.
-
-target="$1"; shift
-
-if [ -z "$target" ]; then
-  target=wildmutt
-  #target=curie
-fi
-
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+source "$FEISTY_MEOW_SCRIPTS/archival/comparator.sh"
 
-function do_a_folder_compare()
-{
-  local archname="$1"; shift
-  local dest="$1"; shift
-#hmmm: error checking?
-
-  if [ -d "/z/$archname" ]; then
-    sep 14
-    echo "Comparing $archname folder..."
-    compare_dirs /z/${archname} ${dest}:/z/${archname}
-    sep 14
-  fi
-}
-
-for archicle in \
-  basement \
-  imaginations \
-  musix \
-  toaster \
-  walrus \
-; do
-  do_a_folder_compare $archicle $target
-done
 
-#cruft:
-#sep 14
-#echo "Comparing basement folder..."
-#compare_dirs /z/basement ${target}:/z/basement
-#sep 14
-#
-#sep 14
-#echo "Comparing imaginations folder..."
-#compare_dirs /z/imaginations ${target}:/z/imaginations
-#sep 14
-#
-#sep 14
-#echo "Comparing musix folder..."
-#compare_dirs /z/musix ${target}:/z/musix
-#sep 14
-#
-#sep 14
-#echo "Comparing walrus folder..."
-#compare_dirs /z/walrus ${target}:/z/walrus
-#sep 14