home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 6
/
FreshFish_September1994.bin
/
gnu
/
packgnu.sh
< prev
next >
Wrap
Linux/UNIX/POSIX Shell Script
|
1994-09-07
|
2KB
|
73 lines
#! /bin/sh
#
# Create archives for the BBS section of this CD from various parts of the
# GNU tree. To help guide this process, the files in the manifests subdir
# list the contents of each archive. The associated product info file is
# either by looking for an appropriate *-pi file in the manifests subdir,
# or from the Product-Info in the appropriate source subdir.
workdir=/build/gnu-pack-junk
toolsrcdir=src/amiga
rootdir=GNU
manifests=manifests
bbsdir=BBS:$rootdir
# Check to see that the output BBS directory exists. If not, create it.
if test ! -d $bbsdir
then
echo "mkdir -p $bbsdir"
mkdir -p $bbsdir
fi
for tool in `(cd $manifests; echo *-src *-bin *-diffs)`
do
echo "========="
# Remove any old trash and create a fresh working directory.
if test -d $workdir/$rootdir
then
echo "rm -rf $workdir/$rootdir"
rm -rf $workdir/$rootdir
fi
echo "mkdir -p $workdir/$rootdir"
mkdir -p $workdir/$rootdir
# Make a copy of all files that we want in the archive under
# $workdir/$rootdir. The files listed in the manifests files
# are relative to the current working directory (GNU).
echo "tar -c -T $manifests/$tool -f $workdir/$rootdir/tar.out"
tar -c -T $manifests/$tool -f $workdir/$rootdir/tar.out
echo "(cd $workdir/$rootdir && tar -xf tar.out && rm tar.out)"
(cd $workdir/$rootdir && tar -xf tar.out && rm tar.out)
# Now make an lha archive in $workdir that is rooted in $rootdir,
# and if successful, copy it to the BBS/$rootdir directory.
echo "(cd $workdir && lha -mraxeq a $tool.lha $rootdir && cp $tool.lha $bbsdir/$tool.lha)"
(cd $workdir && lha -mraxeq a $tool.lha $rootdir && cp $tool.lha $bbsdir/$tool.lha)
# Locate an appropriate product info file and install a copy of the product
# info file alongside the archive.
pifilein=""
pifileout="$bbsdir/$tool.lha.pi"
srcname=`echo $tool | sed -e "s:-src::" -e "s:-bin::" -e "s:-diffs::"`
if test -f $manifests/$tool-pi
then
pifilein="$manifests/$tool-pi"
elif test -f $toolsrcdir/$srcname/Product-Info
then
pifilein="$toolsrcdir/$srcname/Product-Info"
fi
if test -n "$pifilein"
then
echo "cp $pifilein $pifileout"
cp $pifilein $pifileout
else
echo "WARNING: no product info file found to generate $pifileout"
fi
done