Fix comment, check for missing files. Back-port improvements from 2.6.2[56] to 2...
[releases.git] / deblob-2.6.25
index 4b77403429988d3a777be6224a1ca0552b068766..eeef0aebcd7b03054426bb28ef2cf3ff3626aa1e 100755 (executable)
@@ -63,11 +63,18 @@ fi
 
 function clean_file {
        #$1 = filename
+       if test ! -f $1; then
+               echo $1 does not exist, something is wrong >&2
+               exit 1
+       fi
        rm -v $1
 }
 
 function check_changed {
-       if cmp $1.deblob $1 > /dev/null; then
+       if test ! -f $1; then
+               echo $1 does not exist, something is wrong >&2
+               exit 1
+       elif cmp $1.deblob $1 > /dev/null; then
                echo $1 did not change, something is wrong >&2
                exit 1
        fi
@@ -77,6 +84,10 @@ function check_changed {
 function clean_blob {
        #$1 = filename
        if $have_check; then
+           if test ! -f $1; then
+               echo $1 does not exist, something is wrong >&2
+               exit 1
+           fi
            name=$1
            echo Removing blobs from $name
            set fnord "$@" -d