3 # This script creates a distribution tape of the current directory
4 # excluding all the files listed in NO_DISTRIBUTE.
10 if [ x
$NO_DISTRIBUTE = x
]; then
11 echo "Missing the distribution file"
15 PATH
=/bin
:/usr
/bin
:/usr
/ucb
:/usr
/local
/bin
17 PROPDIR
=`basename $DIR`
18 echo "Creating distribution for $PROPDIR"
19 rm -f MANIFEST TIMESTAMP
20 echo "Distribution made on `date` by `whoami`" >TIMESTAMP
23 if [ -f $NO_DISTRIBUTE ]; then
24 PAT
=`grep -v '^#' $NO_DISTRIBUTE`
25 PAT
="^(@@@|"`echo "$PAT" | tr '\012' '|'`"@@@)\$"
28 find $PROPDIR ! -type d
-print |
egrep -v "$PAT" |
sort > $PROPDIR/MANIFEST
31 find $PROPDIR ! -type d
-print |
sort > $PROPDIR/MANIFEST
33 echo "Distributing list MANIFEST created"
35 tar -cvf $PROPDIR.
tar $PROPDIR/MANIFEST
39 MARKER
=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
40 FILES
=`cat $PROPDIR/MANIFEST`
41 for file in $FILES ; do
43 SMALL_LIST
="$SMALL_LIST $file"
44 if [ $COUNT = $MARKER ]; then
45 tar -rvf $PROPDIR.
tar $SMALL_LIST;
50 tar -rvf $PROPDIR.
tar $SMALL_LIST $PROPDIR/MANIFEST
52 if [ -f $PROPDIR.
tar.gz
]; then
53 echo "Moving $PROPDIR.tar.gz to $PROPDIR.tar.gz.bak"
54 mv $PROPDIR.
tar.gz
$PROPDIR.
tar.gz.bak
56 echo "gzip $PROPDIR.tar"
58 echo "Distribution file is in ../$PROPDIR.tar.gz"