]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_movefiles
r583: * dh_movefiles: Do not pass --remove-files to tar, since that makes
[debhelper.git] / dh_movefiles
index 97427b8d08d3604ef979492c181d8bbac57b41a5..8762487ac6bd10a4480f10d83dedc87b89792964 100755 (executable)
@@ -11,7 +11,7 @@ use Debian::Debhelper::Dh_Lib;
 
 =head1 SYNOPSIS
 
-B<dh_movefiles> [S<I<debhelper options>>] [B<--sourcedir=>I<dir>] [S<I<file ...>>]
+B<dh_movefiles> [S<I<debhelper options>>] [B<--sourcedir=>I<dir>] [B<-X>I<item>] S<I<file ...>>]
 
 =head1 DESCRIPTION
 
@@ -41,6 +41,11 @@ the sourcedir is moved, specifiying something like --sourcedir=/ is very
 unsafe, so to prevent mistakes, the sourcedir must be a relative filename;
 it cannot begin with a `/'.
 
+=item B<-Xitem>, B<--exclude=item>
+
+Exclude files that contain "item" anywhere in their filename from
+being installed.
+
 =item I<file ...>
 
 Lists files to move. The filenames listed should be relative to
@@ -126,11 +131,19 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                                warning("$file not found (supposed to put it in $package)");
                        }
                        $file=~s:^\Q$sourcedir\E/+::;
-                       complex_doit("(cd $sourcedir >/dev/null ; find $file ! -type d -print || true) >> debian/movelist");
+                       my $cmd="(cd $sourcedir >/dev/null ; find $file ! -type d ";
+                       if ($dh{EXCLUDE_FIND}) {
+                               $cmd.="-a ! \\( $dh{EXCLUDE_FIND} \\) ";
+                       }
+                       $cmd.="-print || true) >> debian/movelist";
+                       complex_doit($cmd);
                }
                my $pwd=`pwd`;
                chomp $pwd;
-               complex_doit("(cd $sourcedir >/dev/null ; tar --create --remove-files --files-from=$pwd/debian/movelist --file -) | (cd $tmp >/dev/null ;tar xpf -)");
+               complex_doit("(cd $sourcedir >/dev/null ; tar --create --files-from=$pwd/debian/movelist --file -) | (cd $tmp >/dev/null ;tar xpf -)");
+               # --remove-files is not used above because tar then doesn't
+               # preserve hard links
+               complex_doit("cd $sourcedir >/dev/null ; cat $pwd/debian/movelist | xargs rm -f)");
                doit("rm","-f","debian/movelist");
        }
 }
@@ -146,7 +159,7 @@ exit $ret;
 
 =head1 SEE ALSO
 
-L<debhelper(1)>
+L<debhelper(7)>
 
 This program is a part of debhelper.