From 6efb39a88e9a882d183b58c90dc0bab1bd3fbd88 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 22 Jan 2007 16:36:33 -0500 Subject: [svn-r13168] Purpose: bug fix. Problem: 1. The last fix using "svn --version" did not work since the source code is shared between different machines which have different svn versions. Changed the code to inspect the .svn/entries content to guess what version of svn uses. From that to decide which GETSVNENTRIES to use. 2. GETSVNENTRIES_14 had two errors: 2.a., % as 1,$ is actually not recognized by ed. Changed that to "1,$s/..." but that got mixed up with $ being a shell meta-character. Changed to use g command instead. (Could have use \ to escape $ but g is cleaner.) 2.b., Some directories have no files but sub-directories. The ed script might end up with an empty file in some steps and ed does not like to run g command with an empty file. Fixed it by adding a dummy blank line. Platforms tested: Osage and copper. --- bin/chkmanifest | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/bin/chkmanifest b/bin/chkmanifest index 81a911f..bcb9dc4 100755 --- a/bin/chkmanifest +++ b/bin/chkmanifest @@ -62,6 +62,9 @@ GETSVNENTRIES_14 () # 2. find them by looking for "file" first, then mark its preceding line as # wanted. # 3. remove all non-marked line. +# 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 the marks. { SVNENTRY=/tmp/H5_SVNENTRY.$$ cp $1/entries $SVNENTRY @@ -69,7 +72,10 @@ chmod u+w $SVNENTRY # entries file is not writable. ed - $SVNENTRY < /dev/null 2>&1;then getsvnentries=GETSVNENTRIES_13 - ;; -esac +elif grep '^file$' $svn_entry_file > /dev/null 2>&1; then + getsvnentries=GETSVNENTRIES_14 +else + echo "Unknow svn entries format. Aborted" + exit 1 +fi for svn in `find . -type d -name .svn -print`; do path=`echo $svn |sed 's/\/.svn//'` -- cgit v0.12