From b50178ea1a00b36e0491e00bbb84dcf0ed862d29 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Thu, 9 Jul 2009 11:44:47 -0500 Subject: [svn-r17172] Add simple perl script supplied by user to check for duplicate entries in MANIFEST. Duplicate entries will be reported along with any other MANIFEST errors and cause exit value to be 1. Tested on jam, linew, smirom, and tg-login2. --- bin/chkmanifest | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/bin/chkmanifest b/bin/chkmanifest index dd30144..4f70a6d 100755 --- a/bin/chkmanifest +++ b/bin/chkmanifest @@ -107,6 +107,21 @@ else fi fi +# Check for duplicate entries. This can be done at any time, but it may as +# well be sooner so that if something else fails the presence of duplicates +# will already be known. +errcode=0 +DUPLICATES=`perl -ne 's/#.*//; next if /^\s*$/; if ($uniq{$_}++) { print $_; }' MANIFEST` +if [ "$DUPLICATES" ]; then + cat 1>&2 <$MANIFEST @@ -117,6 +132,7 @@ for file in `cat $MANIFEST`; do fi done + # Inspect the .svn/entries to figure out what version of svn file entry is # used. # The following algorithm is formed via reverse engineering. @@ -130,7 +146,7 @@ if head -1 $svn_entry_file | grep 'xml version="1.0"' > /dev/null 2>&1;then elif grep '^file$' $svn_entry_file > /dev/null 2>&1; then getsvnentries=GETSVNENTRIES_14 else - echo "Unknow svn entries format. Aborted" + echo "Unknown svn entries format. Aborted" exit 1 fi @@ -155,5 +171,9 @@ EOF exit 1 fi +if [ $errcode > 0 ]; then + exit $errcode +fi + test "$verbose" && echo " The MANIFEST is up to date." 1>&2 exit 0 -- cgit v0.12