[Pcsclite-cvs-commit] HandlerTest MANIFEST,NONE,1.1 Makefile,NONE,1.1 create_distrib.sh,NONE,1.1

rousseau@quantz.debian.org rousseau@quantz.debian.org
Fri, 29 Aug 2003 08:51:59 +0200


Update of /cvsroot/pcsclite/HandlerTest
In directory quantz:/tmp/cvs-serv21658

Added Files:
	MANIFEST Makefile create_distrib.sh 
Log Message:
add files for archive easy generation


--- NEW FILE: MANIFEST ---
Changelog
Host/debug.c
Host/debug.h
Host/.dependencies
Host/handler_test.1
Host/handler_test.c
Host/ifdhandler.h
Host/Makefile
Host/parser.h
Host/TODO
Host/tokenparser.l
README

--- NEW FILE: Makefile ---
# $Id: Makefile,v 1.1 2003/08/29 06:51:57 rousseau Exp $

clean:
	make -C Host clean

distclean:
	make -C Host distclean


--- NEW FILE: create_distrib.sh ---
#/bin/sh -e

# $Id: create_distrib.sh,v 1.1 2003/08/29 06:51:57 rousseau Exp $

# create a new directory named after the current directory name
# the directory name should be in the form foo-bar.x.y.z
# the use of "_" is not recommanded since it is a problem for Debian

dir=$(basename $(pwd))-$(perl -ne 'if (m/^\d.\d.\d/) { s/ .*//; print; exit;}' README)

echo -e "Using $dir as directory name\n"

rv=$(echo $dir | sed -e 's/.*-[0-9]\.[0-9]\.[0-9]/ok/')
if [ $rv != "ok" ]
then
	echo "ERROR: The directory name should be in the form foo-bar-x.y.z"
	exit
fi

if [ -e $dir ]
then
	echo -e "ERROR: $dir already exists\nremove it and restart"
	exit
fi

# clean
echo -n "cleaning..."
make distclean &> /dev/null
echo "done"

# generate Changelog
rcs2log | sed -e s+/cvsroot/pcsclite/Drivers/ccid/++g > Changelog

present_files=$(tempfile)
manifest_files=$(tempfile)
diff_result=$(tempfile)

# find files present
# remove ^debian and ^create_distrib.sh
find -type f | grep -v CVS | cut -c 3- | grep -v ^create_distrib.sh | sort > $present_files
cat MANIFEST | sort > $manifest_files

# diff the two lists
diff $present_files $manifest_files | grep '<' | cut -c 2- > $diff_result

if [ -s $diff_result ]
then
	echo -e "WARGING! some files will not be included in the archive.\nAdd them in MANIFEST"
	cat $diff_result
	echo
fi

# remove temporary files
rm $present_files $manifest_files $diff_result

# create the temporary directory
mkdir $dir

for i in $(cat MANIFEST)
do
	if [ $(echo $i | grep /) ]
	then
		idir=$dir/${i%/*}
		if [ ! -d $idir ]
		then
			echo "mkdir $idir"
			mkdir $idir
		fi
	fi
	echo "cp $i $dir/$i"
	cp -a $i $dir/$i
done

tar czvf ../$dir.tar.gz $dir
rm -r $dir