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"
16 # debian/files has a different purpose, so ignore it.
17 if [ "$files" -a "$files" != "debian/files" ]; then
18 if [ "$TMP" = "debian/tmp" ]; then
19 error "I was asked to move some files from debian/tmp to debian/tmp."
22 if [ ! -d "$TMP" ]; then
23 doit "install -d $TMP"
28 # Order the files. First all real files, then symlinks.
29 # Putting symlinks last is a nice thing to do for library
30 # packages and doesn't affect much of anything else.
32 # (The echo is in here to expand wildcards. Note that 'ls'
33 # won't work properly.)
35 for i in `(cd debian/tmp ; echo \`cat $files\`)`; do
36 tomove="`(cd debian/tmp ; \
37 find $i ! -type d -and ! -type l -print)` \
40 find $i ! -type d -and -type l -print)`"
43 complex_doit "(cd debian/tmp;tar --create --remove-files --file - "$tomove") | (cd $TMP;tar xpf -)"