Annotation of hypermess/hypermail/maketgz, revision 1.2

1.1       kahan       1: #! /bin/sh
                      2: # Script to build release-archives with
                      3: #
                      4: 
1.2     ! kahan       5: echo "Version number ?"
1.1       kahan       6: read version
                      7: 
1.2     ! kahan       8: echo "Patchlevel ?"
        !             9: read patchlevel
        !            10: 
1.1       kahan      11: HEADER="patchlevel.h"
                     12: 
                     13: # Replace version number in header file:
1.2     ! kahan      14: sed -e 's/#define VERSION.*/#define VERSION "'$version'"/g' \
        !            15:     -e 's/#define PATCHLEVEL.*/#define PATCHLEVEL "'$patchlevel'"/g' $HEADER >$HEADER.new
1.1       kahan      16: 
                     17: # Save old header file
                     18: cp -p $HEADER $HEADER.old
                     19: 
                     20: # Make new header:
                     21: mv $HEADER.new $HEADER
                     22: 
                     23: # get current dir
                     24: dir=`pwd`
                     25: 
                     26: # Get basename
                     27: orig=`basename $dir`
                     28: 
                     29: # Get the left part of the dash (-)
                     30: new=`echo $orig | cut -d- -f1`
                     31: 
                     32: # Build new directory name
                     33: n=$new-$version;
                     34: 
                     35: # Tell the world what we're doing
                     36: echo "creates $n.tar.gz";
                     37: 
                     38: if [ -r $n ]; then
                     39:   echo "Directory already exists!"
                     40:   exit
                     41: fi
                     42: 
                     43: # Create the new dir
                     44: mkdir $n
                     45: 
                     46: # Copy all relevant files, with path and permissions!
1.2     ! kahan      47: tar -cf - `cat FILES | grep -v \#` | (cd $n; tar -xBpf -)
1.1       kahan      48: 
                     49: # Make a tar archive of it all
                     50: tar -cvf $n.tar $n
                     51: 
                     52: # gzip the archive
                     53: gzip $n.tar
                     54: 
                     55: # Make it world readable
                     56: chmod a+r $n.tar.gz ;
                     57: 
                     58: # Delete the temp dir
                     59: rm -rf $n

Webmaster