X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=dh_md5sums;h=a53603e17ea31e09a7b7e5f4d8d97b1a9d15af7d;hb=ec77e19bf7a20d35edadb2089c3632fca8f54ed3;hp=992de40dc9e448890460957477963a847b6333dc;hpb=d7b306162c16a3d261fe6c7420ac484ac3d9f3ea;p=debhelper.git diff --git a/dh_md5sums b/dh_md5sums index 992de40..a53603e 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -12,12 +12,13 @@ use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS - dh_md5sums [debhelper options] [-x] [-Xitem] [--include-conffiles] +B [S>] [B<-x>] [B<-X>I] [B<--include-conffiles>] =head1 DESCRIPTION dh_md5sums is a debhelper program that is responsible for generating a DEBIAN/md5sums file, which lists the md5sums of each file in the package. +These files are used by the debsums package. All files in DEBIAN/ are omitted from the md5sums file, as are all conffiles (unless you use the --include-conffiles switch). @@ -45,6 +46,8 @@ being listed in the md5sums file. init(); foreach my $package (@{$dh{DOPACKAGES}}) { + next if is_udeb($package); + my $tmp=tmpdir($package); if (! -d "$tmp/DEBIAN") { @@ -53,13 +56,13 @@ foreach my $package (@{$dh{DOPACKAGES}}) { # Check if we should exclude conffiles. my $exclude=""; - if (! $dh{INCLUDE} && -r "$tmp/DEBIAN/conffiles") { + if (! $dh{INCLUDE_CONFFILES} && -r "$tmp/DEBIAN/conffiles") { # Generate exclude regexp. open (CONFF,"$tmp/DEBIAN/conffiles"); while () { chomp; s/^\///; - $exclude.="! -path \"$_\" "; + $exclude.="! -path \"./$_\" "; } close CONFF; } @@ -69,21 +72,20 @@ foreach my $package (@{$dh{DOPACKAGES}}) { $exclude.="! \\( $dh{EXCLUDE_FIND} \\) "; } - my $olddir=getcwd(); - complex_doit("cd $tmp >/dev/null ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums ; cd '$olddir' >/dev/null"); + complex_doit("(cd $tmp >/dev/null ; find . -type f $exclude ! -regex '.*/DEBIAN/.*' -printf '%P\\0' | xargs -r0 md5sum > DEBIAN/md5sums) >/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","0.0","$tmp/DEBIAN/md5sums"); + doit("chown","0:0","$tmp/DEBIAN/md5sums"); } } =head1 SEE ALSO -L +L This program is a part of debhelper.