- #
- # (The echo is in here to expand wildcards. Note that ls
- # won't work properly.)
- tomove=""
- for i in `(cd debian/tmp ; echo \`cat $files\`)`; do
- tomove="`(cd debian/tmp ; \
- find $i ! -type d -and ! -type l -print)` \
- $tomove \
- `(cd debian/tmp ; \
- find $i ! -type d -and -type l -print)`"
- done
-
- complex_doit "(cd debian/tmp;tar --create --remove-files --file - "$tomove") | (cd $TMP;tar xpf -)"
- fi
-done
+ doit("rm","-f","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");
+ }
+ 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");
+ }
+}
+
+# If $ret is set, we wern't actually able to find some
+# files that were specified to be moved, and we should
+# exit with the code in $ret. This program puts off
+# exiting with an error until all files have been tried
+# to be moved, because this makes it easier for some
+# packages that arn't always sure exactly which files need
+# to be moved.
+exit $ret;