]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_md5sums
r941: This commit was manufactured by cvs2svn to create tag
[debhelper.git] / dh_md5sums
index 4ab9041ab4319cc39f9a3ae5a19fe04e1e7ef093..80b5f4794f9f3014af5d4621a40c2722f931ba61 100755 (executable)
@@ -4,7 +4,7 @@
 # package.
 
 use Cwd;
-BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
+BEGIN { push @INC, "debian", "/usr/share/debhelper" }
 use Dh_Lib;
 init();
 
@@ -27,9 +27,20 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
                }
                close CONFF;
        }
-
+       
+       # See if we should exclude other files.
+       if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
+               $exclude.="! \\( $dh{EXCLUDE_FIND} \\) ";
+       }
+       
        $olddir=getcwd();
-       complex_doit("cd $TMP ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -0 md5sum > DEBIAN/md5sums ; cd $olddir");
-       doit("chmod",644,"$TMP/DEBIAN/md5sums");
-       doit("chown","root.root","$TMP/DEBIAN/md5sums");
+       complex_doit("cd $TMP >/dev/null ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums ; cd $olddir >/dev/null");
+       # If the file's empty, no reason to waste inodes on it.
+       if (-z "$TMP/DEBIAN/md5sums") {
+               doit("rm","-f","$TMP/DEBIAN/md5sums");
+       }
+       else {
+               doit("chmod",644,"$TMP/DEBIAN/md5sums");
+               doit("chown","root.root","$TMP/DEBIAN/md5sums");
+       }
 }