]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_md5sums
cmake: Pass CPPFLAGS in CFLAGS. Closes: #668813 Thanks, Simon Ruderich for the patch...
[debhelper.git] / dh_md5sums
index 91c217e20ad8a66b3211b6e46b9113e0a9a59186..4a1264be9f373e66b1eddf8ac82b37bacaf36987 100755 (executable)
@@ -16,12 +16,12 @@ B<dh_md5sums> [S<I<debhelper options>>] [B<-x>] [B<-X>I<item>] [B<--include-conf
 
 =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.
+B<dh_md5sums> is a debhelper program that is responsible for generating
+a F<DEBIAN/md5sums> file, which lists the md5sums of each file in the package.
+These files are used by the B<debsums> package.
 
-All files in DEBIAN/ are omitted from the md5sums file, as are all
-conffiles (unless you use the --include-conffiles switch).
+All files in F<DEBIAN/> are omitted from the F<md5sums> file, as are all
+conffiles (unless you use the B<--include-conffiles> switch).
 
 The md5sums file is installed with proper permissions and ownerships.
 
@@ -32,18 +32,21 @@ The md5sums file is installed with proper permissions and ownerships.
 =item B<-x>, B<--include-conffiles>
 
 Include conffiles in the md5sums list. Note that this information is
-redundant since it is included elsewhere in debian packages.
+redundant since it is included elsewhere in Debian packages.
 
 =item B<-X>I<item>, B<--exclude=>I<item>
 
-Exclude files that contain "item" anywhere in their filename from
+Exclude files that contain I<item> anywhere in their filename from
 being listed in the md5sums file.
 
 =back
 
 =cut
 
-init();
+init(options => {
+       "x" => \$dh{INCLUDE_CONFFILES}, # is -x for some unknown historical reason..
+       "include-conffiles" => \$dh{INCLUDE_CONFFILES},
+});
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
        next if is_udeb($package);
@@ -62,7 +65,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                while (<CONFF>) {
                        chomp;
                        s/^\///;
-                       $exclude.="! -path \"$_\" ";
+                       $exclude.="! -path \"./$_\" ";
                }
                close CONFF;
        }
@@ -72,8 +75,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                $exclude.="! \\( $dh{EXCLUDE_FIND} \\) ";
        }
        
-       my $olddir=getcwd();
-       complex_doit("cd $tmp >/dev/null ; find -type f $exclude ! -regex '.*/DEBIAN/.*' -printf '%P\\0' | xargs -r0 md5sum > DEBIAN/md5sums ; cd '$olddir' >/dev/null");
+       my $find="find . -type f $exclude ! -regex './DEBIAN/.*' -printf '%P\\0'";
+       complex_doit("(cd $tmp >/dev/null ; $find | LC_ALL=C sort -z | 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");