add directory bin
This commit is contained in:
39
bin/old/bash-1.05/make-tarfile
Executable file
39
bin/old/bash-1.05/make-tarfile
Executable file
@@ -0,0 +1,39 @@
|
||||
#! /bin/sh
|
||||
# How to make a distribution tarfile.
|
||||
#
|
||||
# $1 is the name of the program.
|
||||
# $2 is the version number.
|
||||
# Remaining args are files to tar.
|
||||
|
||||
PROGRAM=$1
|
||||
VERSION=$2
|
||||
|
||||
shift; shift
|
||||
|
||||
if [ "$PROGRAM" = "" -o "$VERSION" = "" ]; then
|
||||
echo "Usage: make-tarfile <progname> <version> <file ...>"
|
||||
exit 2;
|
||||
fi
|
||||
|
||||
TARFILE=$PROGRAM.tar
|
||||
TARDIR=$PROGRAM-$VERSION
|
||||
|
||||
rm -rf $TARFILE $TARDIR
|
||||
mkdir $TARDIR
|
||||
(cd $TARDIR; for i in $*; do
|
||||
file=`basename $i`
|
||||
dir=`echo $i | sed "s/$file\$//" | sed 's@\(.*\)/\$@\1@'`
|
||||
if [ "$dir" = "" ]; then dir="."; fi
|
||||
if [ "$dir" != "." ]; then
|
||||
if [ ! -d "$dir" ]; then mkdir "$dir"; fi
|
||||
ln -s ../../$i $i; \
|
||||
else
|
||||
ln -s ../$i $i
|
||||
fi
|
||||
done)
|
||||
|
||||
tar -chf $TARFILE $TARDIR
|
||||
rm -rf $TARDIR
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user