3 # Move files out of debian/tmp, into subpackages.
5 PATH=debian:$PATH:/usr/lib/debhelper
8 for PACKAGE in $DH_DOPACKAGES; do
10 files=`pkgfile $PACKAGE files`
12 if [ ! -d "debian/tmp" ]; then
13 error "debian/tmp does not exist"
18 # debian/files has a different purpose, so ignore it.
19 if [ "$files" -a "$files" != "debian/files" ]; then
23 if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \
28 if [ "$tomove" -a "$TMP" = "debian/tmp" ]; then
29 error "I was asked to move files from debian/tmp to debian/tmp."
32 if [ "$tomove" ]; then
33 if [ ! -d "$TMP" ]; then
34 doit "install -d $TMP"
37 # Order the files. First all real files, then symlinks.
38 # Putting symlinks last is a nice thing to do for library
39 # packages and doesn't affect much of anything else.
41 # (The echo is in here to expand wildcards. Note that 'ls'
42 # won't work properly.)
43 # The file list is used, so even very weird filenames can be
46 for i in `(cd debian/tmp; echo $tomove)`; do
47 if [ ! -e "debian/tmp/$i" ]; then
50 complex_doit "(cd debian/tmp ; find $i ! -type d -and ! -type l -print || true) >> movelist"
52 for i in `(cd debian/tmp; echo $tomove)`; do
53 if [ ! -e "debian/tmp/$i" ]; then
56 complex_doit "(cd debian/tmp ; find $i ! -type d -and -type l -print || true) >> movelist"
58 complex_doit "(cd debian/tmp;tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP;tar xpf -)"
63 # If fail is set, we wern't actually able to find some
64 # files that were specified to be moved, and we should
65 # exit with the code in fail. This program puts off
66 # exiting with an error until all files have been tried
67 # to be moved, because this makes it easier for some
68 # packages that arn't always sure exactly which files need