add check for missing busybox.distrib.version in prerm
[busybox-power] / debian / busybox-power.prerm
index 005916b..e7314d5 100644 (file)
@@ -46,12 +46,21 @@ CHECK_BACKUP() {
     # Secondly, check the integrity of the backup
     if test -e $INSTALLDIR/busybox.distrib.sha1; then
       if test "`cat $INSTALLDIR/busybox.distrib.sha1`" != "$ORIGBINARY_SHA1"; then
-        if test "`cat $INSTALLDIR/busybox.distrib.version`" == "`GETBBVERSION`"; then
-          # The backup has been changed whilst busybox hasn't been upgraded
+        if test -e $INSTALLDIR/busybox.distrib.version; then
+          if test "`cat $INSTALLDIR/busybox.distrib.version`" == "`GETBBVERSION`"; then
+            # The backup has been changed whilst busybox hasn't been upgraded
+            echo -e "Warning: the backup of the original BusyBox binary has" \
+              "been modified since installing busybox-power (invalid SHA1" \
+              "checksum). Do not continue unless you're sure that $DISTBIN" \
+              "is not corrupted.\n" >> /tmp/busybox-power-error
+          fi
+        else
           echo -e "Warning: the backup of the original BusyBox binary has" \
-            "been modified since installing busybox-power (invalid SHA1" \
-            "checksum). Do not continue unless you're sure that $DISTBIN" \
-            "is not corrupted.\n" >> /tmp/busybox-power-error
+          "been modified since installing busybox-power (invalid SHA1" \
+          "checksum). We could not determine whether this is due to a BusyBox" \
+          "upgrade (e.g. by an (C)SSU update) or not. Do not continue unless" \
+          "either the latter is the case, or you're via other ways sure that" \
+          "$DISTBIN is not corrupted.\n" >> /tmp/busybox-power-error
         fi
       fi
     else