#!/bin/sh

H=`pwd`
DIR=`dirname $H`
PDIR=`basename $H`
OUT=$DIR/../Handoffs/$PDIR.cpio.Z
DOC=$DIR/../Handoffs/$PDIR-doc.tar.Z

# First, handoff the doc for docview and remove it from here
[ -d usr/share/gimp-print/doc/html ] && {
    [ -d usr/share/gimp-print/doc/manual-html ] || {
        echo "ERROR: missing doc directory! Exiting."
        exit 1
    }
    tar cf - usr/share/gimp-print/doc/*html | /usr/bin/compress -H > $DOC
    rm -rf usr/share/gimp-print/doc/*html
}

# Now handoff the CDMT files for GimpPrint
cd $DIR

rm -f $OUT
rm -rf $PDIR/sso $PDIR/archives

/bin/find $PDIR -depth -print | /bin/cpio -oc | /usr/bin/compress -H > $OUT
