]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_movefiles
r383: * dh_movefiles: no longer does the symlink ordering hack, as
[debhelper.git] / dh_movefiles
index e02637330154edb76741f6be06f8c6380132eaca..f2ea12315dac24ed702b406a2cb2f45ac43322b1 100755 (executable)
@@ -2,8 +2,7 @@
 #
 # Move files out of debian/tmp, into subpackages.
 
-BEGIN { push @INC, "debian", "/usr/share/debhelper" }
-use Dh_Lib;
+use Debian::Debhelper::Dh_Lib;
 init();
 
 $ret=0;
@@ -38,7 +37,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
        }
 
        if (@tomove && $TMP eq $sourcedir) {
-               error("I was asked to move files from $sourcedir to $sourcedir.");
+               error("I was asked to move files from $sourcedir to $sourcedir. Perhaps you should set DH_COMAPT=2?");
        }
 
        if (@tomove) {
@@ -57,21 +56,15 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
                # Order the files. First all real files, then symlinks. 
                # Putting symlinks last is a nice thing to do for library 
                # packages and doesn't affect much of anything else.
-               doit("rm","-f","movelist");
+               doit("rm","-f","debian/movelist");
                foreach (@filelist) {
                        $file=$_;
                        $ret=1 if (! -e $file && ! -l $file);
-                       $file=~s:^$sourcedir/+::;
-                       complex_doit("(cd $sourcedir >/dev/null ; find $file ! -type d -and ! -type l -print || true) >> movelist");
+                       $file=~s:^\Q$sourcedir\E/+::;
+                       complex_doit("(cd $sourcedir >/dev/null ; find $file ! -type d -print || true) >> debian/movelist");
                }
-               foreach (@filelist) {
-                       $file=$_;
-                       $ret=1 if (! -e $file && ! -l $file);
-                       $file=~s:^$sourcedir/+::;
-                       complex_doit("(cd $sourcedir >/dev/null ; find $file ! -type d -and -type l -print || true) >> movelist");
-               }
-               complex_doit("(cd $sourcedir >/dev/null ; tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP >/dev/null ;tar xpf -)");
-               doit("rm","-f","movelist");
+               complex_doit("(cd $sourcedir >/dev/null ; tar --create --remove-files --files-from=../movelist --file -) | (cd $TMP >/dev/null ;tar xpf -)");
+               doit("rm","-f","debian/movelist");
        }
 }