home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / src / baseline / bbs-copy.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1995-01-26  |  1KB  |  39 lines

  1. #! /bin/sh
  2. #
  3. # Copy selected baseline archives from this directory to the BBS portion
  4. # of the CD.  The associated product info file is found by looking for
  5. # a matching tree in the the source directory.  If it is not found, the
  6. # copy is not done.
  7.  
  8. srcroot=/gnu/src/amiga
  9. bbsdir=$1
  10.  
  11. # Check to see that the output BBS directory exists.  If not, exit.
  12.  
  13. if test ! -d $bbsdir ; then
  14.     echo "$bbsdir does not exist!"
  15.     exit 1
  16. fi
  17.  
  18. for archive in *.lha *.tar.gz ; do
  19.     case "$archive" in
  20.         *.lha) toolname=`basename $archive .lha` ;;
  21.         *.tar.gz) toolname=`basename $archive .tar.gz` ;;
  22.     esac
  23.     pifilein=""
  24.     if test -f $archive.pi ; then
  25.         pifilein="$archive.pi"
  26.     elif test -f $srcroot/$toolname-src.lha.pi ; then
  27.         pifilein="$srcroot/$toolname-src.lha.pi"
  28.     fi
  29.     if test -z "${pifilein}" ; then
  30.         echo "WARNING - $archive ignored; missing product info file"
  31.     else
  32.         pifileout="$bbsdir/$archive.pi"
  33.         echo "cp $pifilein $pifileout"
  34.         cp $pifilein $pifileout
  35.         echo "cp $archive $bbsdir/$archive"
  36.         cp $archive $bbsdir/$archive
  37.     fi
  38. done
  39.