Commit 52a3fa44 52a3fa44e9c6e5832a0a27328dc6a8858db06217 by Sergey Poznyakoff

New file. Prepares data for testsuite.

1 parent 5641e5df
#! /bin/sh
if [ "$1" = "-r"]; then
shift
rm -rf $*
exit 0
fi
mkdirhier() {
dir=""
for d in `echo $1|sed 's,/, ,g'`
do
dir="$dir/$d"
test -d $dir || mkdir $dir
done
}
while [ $# -gt 0 ]
do
SRCDIR=${1:?}
DSTDIR=${2:?}
shift 2
if [ ! -d $SRCDIR ]; then
echo "$SRCDIR not a directory" >&2
exit 1
fi
if [ ! -r $SRCDIR/DISTFILES ]; then
echo "$SRCDIR/DISTFILES does not exist" >&2
exit 1
fi
mkdirhier $DSTDIR
chmod -R u+w $DSTDIR
cat $SRCDIR/DISTFILES |
while read NAME
do
test -f $DSTDIR/$NAME && rm $DSTDIR/$NAME
cp $SRCDIR/$NAME $DSTDIR/$NAME
chmod u+w $DSTDIR/$NAME
done
done
\ No newline at end of file