qse/ase/rel/rel.sh

75 lines
1.1 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:01:26 +00:00
root="$BASE/ase-$VER"
2007-02-04 13:00:37 +00:00
target="$root/ase"
2007-02-03 11:54:02 +00:00
mkdir -p "$target/$cur"
case "$full" in
*.h|*.c|*.cc|*.cpp|*.java|*.awk|*.in)
2007-02-04 13:01:26 +00:00
"$HOME/awk" -f "$BASE/rel/lic.awk" -a "$target/$file" "$full"
2007-02-03 11:54:02 +00:00
;;
*)
cp -f "$full" "$target/$file"
;;
esac
2007-02-04 13:01:26 +00:00
#echo "$full,$BASE,$file: $BASE/xxx/$file [OK]"
2007-02-03 11:54:02 +00:00
fi
done
}
2007-02-04 12:41:21 +00:00
if [ ! -f ../CVS/Tag ]
2007-02-04 12:37:46 +00:00
then
2007-02-04 12:41:21 +00:00
echo "Error: ../CVS/Tag not found"
2007-02-04 13:01:26 +00:00
#exit 1;
2007-02-04 12:37:46 +00:00
fi
2007-02-04 13:00:37 +00:00
VER=`cat ../CVS/Tag | cut -c6- | tr '[A-Z]' '[a-z]' | sed 's/_/./g`
2007-02-04 13:01:26 +00:00
VER="0.1.0"
2007-02-04 12:41:21 +00:00
2007-02-03 11:54:02 +00:00
cwd=`pwd`
cd ".."
2007-02-04 13:01:26 +00:00
BASE=`pwd`
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-03 11:54:02 +00:00
exit 0