better checking for uninstalled changes in btrfs send related scripts
[distro-setup] / btrbk-run
index c33ed66904832bff7ecdcf0b5873413098395ed5..140f9e6053fdef509aace78d1186fee1c0abe26f 100644 (file)
--- a/btrbk-run
+++ b/btrbk-run
@@ -413,6 +413,26 @@ fi
 echo "mountpoints: ${mountpoints[*]}"
 
 
+uninstalled-file-die() {
+  err "uninstalled file $1. run install-my-scripts or rerun with -f"
+  exit 1
+}
+if ! $force; then
+  install_bin_files=(
+    mount-latest-subvol
+    check-subvol-stale
+    btrbk-run
+  )
+  for f in ${install_bin_files[@]}; do
+    if ! diff -q /a/bin/ds/$f /usr/local/bin/$f; then
+      uninstalled-file-die $f
+    fi
+  done
+  if ! diff -q /a/bin/errhandle/err /usr/local/lib/err; then
+    uninstalled-file-die err
+  fi
+fi
+
 
 # pull_reexec stops us from getting into an infinite loop if there is some
 # kind of weird problem