home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #
- #
- # This script takes a NEXTSTEP wrapper directory that has been placed
- # under CVS control as a group of individual files, and converts the
- # directory to a tar'ed and gzip package
- #
- # example if the input directory was Foo.nib with the files in Foo.nib
- # called data.classes,v and data.nib,v the result will be a file called
- # Foo.nib,v with all of the original revisions checked out of the original
- # directory and placed into the new package. (tar'ed and gziped)
- #
- # There is nothing that is NEXTSTEP specific in this shell script
- #
- # written by Vince DeMarco <vdemarco@bou.shl.com>
- #
-
- if [ $# -eq 0 ] ; then
- echo "Usage:" $0 "[files..]"
- exit 0
- fi
-
- for INPUT_FILE in $@ ; do
-
- if [ -d $INPUT_FILE ] ; then
-
- INPUT_BACKUP_FILE=$INPUT_FILE.bak
- MAX_VERSION=0.0
-
- mv -f $INPUT_FILE $INPUT_BACKUP_FILE
- cd $INPUT_BACKUP_FILE
-
- echo "Checked in by $0 - $INPUT_FILE" > /tmp/$$.logmsg
-
- for FILE in * ; do
- VERSION=`rlog -b $FILE | grep head | awk '{ print $2 }'`
- if [ $VERSION -ge $MAX_VERSION ] ; then
- MAX_VERSION=$VERSION
- MAX_FILE=$FILE
- fi
- done
-
- echo "Processing" $INPUT_FILE "max version is" $MAX_VERSION
-
- mkdir ../$INPUT_FILE
-
- for VERSION in `rlog -b $MAX_FILE | grep -v total | \
- grep revision | awk '{ print $2 }' | sort` ; do
-
- echo "\tversion" $VERSION
-
- rm -rf ../$INPUT_FILE/*
-
- for FILE in * ; do
- co -q -r$VERSION $FILE
- mv `basename $FILE ,v` ../$INPUT_FILE/
- done
-
- cd ../
- chmod -R u+w $INPUT_FILE
- rm -rf $$.version
- gnutar Spscf - $INPUT_FILE | gzip --no-name --best -c > $$.version
- ci -q \
- -r$VERSION \
- -m"Checked in by $0 file version $VERSION" \
- -t/tmp/$$.logmsg $$.version
-
- rcs -q -kb -l $$.version
- cd $INPUT_BACKUP_FILE/
- done
-
- rm -rf ../$INPUT_FILE
- cd ..
-
- mv -f $$.version,v $INPUT_FILE,v
- rm -f /tmp/$$.logmsg
- else
- echo $INPUT_FILE "is not a directory or doesn't exist"
- fi
- done
-
- exit 1
-