diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2006-07-20 19:10:19 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2006-07-20 19:10:19 (GMT) |
commit | 4bb0634a6aa5ab35b98df5a788b8653c6a66275a (patch) | |
tree | 341c085813905612bed40bce329a38761eee1229 /bin | |
parent | 7bd77ae5aca77956f5663d2378dd8e25d25415e2 (diff) | |
download | hdf5-4bb0634a6aa5ab35b98df5a788b8653c6a66275a.zip hdf5-4bb0634a6aa5ab35b98df5a788b8653c6a66275a.tar.gz hdf5-4bb0634a6aa5ab35b98df5a788b8653c6a66275a.tar.bz2 |
[svn-r12485] Purpose:
Upgrade
Description:
chnaged it from doing CVS-managed files to SVN-managed files.
(The use of ed, is real ugly, but ed exists in all Unix systems.
May want to consider using awk which is a more powerful and will have
a cleaner implementation.)
Platform tested:
Tested by hand in heping and shanti.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/chkmanifest | 55 |
1 files changed, 48 insertions, 7 deletions
diff --git a/bin/chkmanifest b/bin/chkmanifest index ac0066a..dba4bab 100755 --- a/bin/chkmanifest +++ b/bin/chkmanifest @@ -14,29 +14,70 @@ # # Check that all the files in MANIFEST exist and that (if this is a -# CVS checkout) that all the CVS-managed files appear in the +# SVN checkout) that all the SVN-managed files appear in the # MANIFEST. verbose=yes MANIFEST=/tmp/H5_MANIFEST.$$ +# function definitions + +GETSVNENTRIES () +# Purpose: Extract filenames from the svn entries file +# $1: directory name in which the svn entries is. +# steps: +# 1. remove all single line entries so that step 2 does not fail on them. +# 2. merge all multiple lines entries into single lines. +# 3. remove all non file entries. +# 4. insert a blank line because some entries files has no kind="file" +# entry and ed does not like to do g on an empty file. +# 5. remove everything except the file name. +# 6. remove all blank lines, including the inserted one. +{ +SVNENTRY=/tmp/H5_SVNENTRY.$$ +cp $1/entries $SVNENTRY +chmod u+w $SVNENTRY # entries file is not writable. +ed - $SVNENTRY <<EOF +g/^<.*>$/d +g/^</.,/>$/j +v/kind="file"/d +a + +. +g/.*name="/s/// +g/".*/s/// +g/^$/d +w +q +EOF +cat $SVNENTRY +rm $SVNENTRY +} + + +# Main +test "$verbose" && echo " Checking MANIFEST..." 1>&2 # clean up $MANIFEST file when exits trap "rm -f $MANIFEST" 0 +if [ ! -f MANIFEST ]; then + echo MANIFEST file not found. Abort. + exit 1 +fi + # Copy the manifest file to get a list of file names. grep '^\.' MANIFEST | expand | cut -f1 -d' ' >$MANIFEST -test "$verbose" && echo " Checking MANIFEST..." 1>&2 -test -f $MANIFEST || exit 1 for file in `cat $MANIFEST`; do if [ ! -f $file ]; then echo "- $file" fail=yes fi done -for cvs in `find . -type d -name CVS -print`; do - path=`echo $cvs |sed 's/\/CVS//'` - for file in `grep '^\/' $cvs/Entries |cut -d/ -f2`; do + +for svn in `find . -type d -name .svn -print`; do + path=`echo $svn |sed 's/\/.svn//'` + for file in `GETSVNENTRIES $svn`; do if (grep $path/$file$ $MANIFEST >/dev/null); then : else @@ -49,7 +90,7 @@ done if [ "X$fail" = "Xyes" ]; then cat 1>&2 <<EOF The MANIFEST is out of date. Files marked with a minus sign (-) no -longer exist; files marked with a plus sign (+) are CVS-managed but do +longer exist; files marked with a plus sign (+) are SVN-managed but do not appear in the MANIFEST. Please remedy the situation and try again. EOF exit 1 |