X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=dh_md5sums;h=80b5f4794f9f3014af5d4621a40c2722f931ba61;hb=5386c00b1883bef4ba45179d75d4ba8064c3e147;hp=4ab9041ab4319cc39f9a3ae5a19fe04e1e7ef093;hpb=5501271678d88ac578082ce2d0705ca211d7e980;p=debhelper.git diff --git a/dh_md5sums b/dh_md5sums index 4ab9041..80b5f47 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -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"); + } }