diff options
author | joey <joey> | 1999-08-17 04:21:03 +0000 |
---|---|---|
committer | joey <joey> | 1999-08-17 04:21:03 +0000 |
commit | 7511571c6481101f17f9858357e62d133a8dcb1a (patch) | |
tree | 8d0f7bb4acf149bc2f85f7151877d4b73e1271ed /dh_compress | |
parent | 0495115e6ef5c603dfedae1a918690b078ffff9c (diff) | |
parent | ecff4e2941eefd33c368be7a0ee372406a6d0e94 (diff) | |
download | debhelper-7511571c6481101f17f9858357e62d133a8dcb1a.tar.gz |
r4: Initial Import
Diffstat (limited to 'dh_compress')
-rwxr-xr-x | dh_compress | 66 |
1 files changed, 39 insertions, 27 deletions
diff --git a/dh_compress b/dh_compress index e1f8ed64..a1ff97e3 100755 --- a/dh_compress +++ b/dh_compress @@ -6,35 +6,47 @@ PATH=debian:$PATH:/usr/lib/debhelper source dh_lib -# The config file is a sh script that outputs the files to be compressed -# (typically using find). -if [ -f debian/compress ]; then - files=`sh debian/compress 2>/dev/null` -else - # By default fall back on what the policy manual says to compress. - files=` - find debian/tmp/usr/info debian/tmp/usr/man \ - debian/tmp/usr/X11*/man -type f 2>/dev/null ; - find debian/tmp/usr/doc -type f -size +4k \ - ! -name "*.htm*" ! -name "*.gif" \ - ! -name "debian/tmp/usr/doc/*/copyright" 2>/dev/null - ` -fi +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + EXT=`pkgext $PACKAGE` -if [ "$files" ]; then - # This is just a cosmetic fix. - files=`echo $files | tr "\n" " "` + # Run the file name gatering commands from within the directory + # structure that will be effected. + olddir=`pwd` + cd debian/$TMP - doit "gzip -9 $files" || true -fi + if [ -f debian/${EXT}compress ]; then + # The config file is a sh script that outputs the files to be compressed + # (typically using find). + files=`sh debian/${EXT}compress 2>/dev/null` + else + # By default fall back on what the policy manual says to compress. + files=` + find usr/info usr/man usr/X11*/man -type f 2>/dev/null ; + find usr/doc -type f -size +4k \ + ! -name "*.htm*" ! -name "*.gif" \ + ! -name "copyright" 2>/dev/null + ` + fi -# Fix up symlinks that were pointing to the uncompressed files. -for file in `find debian/tmp -type l`; do - DIRECTORY=`expr $file : "\(.*\)/[^/]*"` - NAME=`expr $file : ".*/\([^/]*\)"` - LINKVAL=`ls -l $DIRECTORY/$NAME | awk '{ print $11;}'` - if [ ! -e $DIRECTORY/$LINKVAL -a -f $DIRECTORY/$LINKVAL.gz ]; then - doit "rm $DIRECTORY/$NAME" - doit "ln -s $LINKVAL.gz $DIRECTORY/$NAME.gz" + if [ "$files" ]; then + # This is just a cosmetic fix. + files=`echo $files | tr "\n" " "` + + doit "gzip -9 $files" || true fi + + # Change back to old pwd. + cd $olddir + + # Fix up symlinks that were pointing to the uncompressed files. + for file in `find debian/$TMP -type l`; do + DIRECTORY=`expr $file : "\(.*\)/[^/]*"` + NAME=`expr $file : ".*/\([^/]*\)"` + LINKVAL=`ls -l $DIRECTORY/$NAME | awk '{ print $11;}'` + if [ ! -e $DIRECTORY/$LINKVAL -a -f $DIRECTORY/$LINKVAL.gz ]; then + doit "rm $DIRECTORY/$NAME" + doit "ln -s $LINKVAL.gz $DIRECTORY/$NAME.gz" + fi + done done |