qse/ase/rel/rel.sh

107 lines
1.8 KiB
Bash
Raw Normal View History

2007-02-03 11:54:02 +00:00
#!/bin/sh
finalize ()
{
2007-02-04 13:01:26 +00:00
cur="$1"; dir="$2";
2007-02-03 11:54:02 +00:00
if [ "$dir" = "" ]
then
2007-02-04 13:01:26 +00:00
cd "$BASE"
2007-02-03 11:54:02 +00:00
else
2007-02-04 13:01:26 +00:00
cd "$BASE/$dir"
2007-02-03 11:54:02 +00:00
fi
for i in *
do
if [ "$i" = "*" ]; then continue; fi
if [ "$i" = "CVS" ]; then continue; fi
2007-02-04 12:37:46 +00:00
if [ "$i" = "stx" ]; then continue; fi
2007-02-03 11:54:02 +00:00
if [ "$cur" = "" ]
then
file="$i"
2007-02-04 13:01:26 +00:00
full="$BASE/$i"
2007-02-03 11:54:02 +00:00
else
file="$cur/$i"
2007-02-04 13:01:26 +00:00
full="$BASE/$cur/$i"
2007-02-03 11:54:02 +00:00
fi
if [ -d "$full" ]
then
if [ "$dir" = "" ]
then
new="$i"
else
new="$dir/$i"
fi
2007-02-04 13:01:26 +00:00
finalize "$file" "$new"
cur="$1"; dir="$2";
2007-02-03 11:54:02 +00:00
elif [ -f "$full" ]
then
2007-02-04 13:30:35 +00:00
target="$SOURCE_ROOT/ase"
2007-02-03 11:54:02 +00:00
mkdir -p "$target/$cur"
2007-02-04 13:30:35 +00:00
case "$i" in
2007-02-03 11:54:02 +00:00
*.h|*.c|*.cc|*.cpp|*.java|*.awk|*.in)
2007-02-09 14:25:46 +00:00
"$ASEAWK" -f "$BASE/rel/lic.awk" -a "$target/$file" "$full"
2007-02-04 13:07:15 +00:00
;;
*.man)
2007-02-04 13:30:35 +00:00
html=`echo $i | sed 's/.man$/.html/'`
2007-02-09 14:25:46 +00:00
"$ASEAWK" -f "$BASE/rel/doc.awk" "$full" > "$SOURCE_ROOT/html/$html"
2007-02-09 14:39:00 +00:00
"$ASEAWK" -f "$BASE/rel/doc.awk" "$full" > "$ASETGT/$html"
2007-02-04 13:07:15 +00:00
cp -f "$full" "$target/$file"
;;
*.css)
cp -f "$full" "$target/$file"
2007-02-04 13:30:35 +00:00
cp -f "$full" "$SOURCE_ROOT/html/$i"
2007-02-09 14:39:00 +00:00
cp -f "$full" "$ASETGT/$i"
2007-02-03 11:54:02 +00:00
;;
*)
cp -f "$full" "$target/$file"
;;
esac
fi
done
}
2007-02-04 12:37:46 +00:00
2007-02-04 13:33:56 +00:00
############################
# BEGINNING OF THE PROGRAM #
############################
2007-02-04 13:07:15 +00:00
2007-02-09 14:39:00 +00:00
if [ $# -ne 3 ]
2007-02-09 14:25:46 +00:00
then
2007-02-09 14:39:00 +00:00
echo "Usage: $0 awk version target"
2007-02-09 14:25:46 +00:00
echo "where awk := full path to aseawk"
echo " version := any string"
2007-02-09 14:39:00 +00:00
echo " target := full path to the target directory"
2007-02-09 14:25:46 +00:00
exit 1
fi
ASEAWK="$1"
ASEVER="$2"
2007-02-09 14:39:00 +00:00
ASETGT="$3"
2007-02-04 12:41:21 +00:00
2007-02-04 13:33:56 +00:00
CURDIR=`pwd`
2007-02-03 11:54:02 +00:00
cd ".."
2007-02-04 13:01:26 +00:00
BASE=`pwd`
2007-02-04 13:33:56 +00:00
2007-02-09 14:39:00 +00:00
SOURCE_ROOT="$ASETGT/ase-$ASEVER"
2007-02-04 13:30:35 +00:00
2007-02-09 14:39:00 +00:00
rm -rf "$ASETGT"
mkdir -p "$ASETGT"
2007-02-04 13:30:35 +00:00
mkdir -p "$SOURCE_ROOT"
mkdir -p "$SOURCE_ROOT/html"
2007-02-04 13:00:37 +00:00
2007-02-04 13:01:26 +00:00
finalize "" ""
2007-02-04 13:00:37 +00:00
2007-02-09 14:39:00 +00:00
cd "$ASETGT"
2007-02-09 14:25:46 +00:00
tar -cvf "ase-$ASEVER.tar" "ase-$ASEVER"
gzip "ase-$ASEVER.tar"
2007-02-09 14:45:12 +00:00
mv "ase-$ASEVER.tar.gz" "ase-$ASEVER.tgz"
2007-02-09 14:25:46 +00:00
rm -rf "ase-$ASEVER"
2007-02-04 13:30:35 +00:00
2007-02-04 13:33:56 +00:00
cd "$CURDIR"
2007-02-03 11:54:02 +00:00
exit 0