summaryrefslogtreecommitdiffstats
path: root/bin/chkmanifest
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2015-03-06 05:13:47 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2015-03-06 05:13:47 (GMT)
commit76d509dd6f454de8b01d0116dc73e56ea5949aa8 (patch)
treebd3291ac545e0ab332624aed7b6435899b13d4ef /bin/chkmanifest
parent50c38a5733bf39c2ba2cdb0de4d03e4aa78b1814 (diff)
downloadhdf5-76d509dd6f454de8b01d0116dc73e56ea5949aa8.zip
hdf5-76d509dd6f454de8b01d0116dc73e56ea5949aa8.tar.gz
hdf5-76d509dd6f454de8b01d0116dc73e56ea5949aa8.tar.bz2
[svn-r26378] Bring revisions #26220 - #26324 from trunk to revise_chunks. h5committested.
Diffstat (limited to 'bin/chkmanifest')
-rwxr-xr-xbin/chkmanifest136
1 files changed, 46 insertions, 90 deletions
diff --git a/bin/chkmanifest b/bin/chkmanifest
index 70c38a9..6188eab 100755
--- a/bin/chkmanifest
+++ b/bin/chkmanifest
@@ -20,75 +20,17 @@
verbose=yes
MANIFEST=/tmp/HD_MANIFEST.$$
-SVNENTRY=/tmp/HD_SVNENTRY.$$
-
-# function definitions
-
-GETSVNENTRIES_13 ()
-# Purpose: Extract filenames from the svn v1.3.* 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.
-{
-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
-}
-
-GETSVNENTRIES_14 ()
-# Purpose: Extract filenames from the svn v1.4.* entries file
-# $1: directory name in which the svn entries is.
-# steps:
-# 1. all valid files are followed by a line containing "file" only.
-# 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.
-{
-cp $1/entries $SVNENTRY
-chmod u+w $SVNENTRY # entries file is not writable.
-ed - $SVNENTRY <<EOF
-g/^file$/-s/^/%WANTED%/
-v/%WANTED%/d
-a
-
-.
-g/^%WANTED%/s///
-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
+# Only split lines on newline, not whitespace
+set -f
+IFS='
+'
+
# First make sure i am in the directory in which there is an MANIFEST file
# and then do the checking from there. Will try the following,
# current directory, parent directory, the directory this command resides.
@@ -132,36 +74,50 @@ for file in `cat $MANIFEST`; do
fi
done
+# Get the list of files under version control and check that they are
+# present.
+#
+# First get a list of all the pending files with svn stat and
+# check those.
+svn_stat="$(svn stat -q)"
+for file in $svn_stat; do
+ # Newly added files are not listed by svn ls, which
+ # we check below..
+ # The line listing them starts with 'A'.
+ letter="$(echo $file | head -c 1)"
+ if [ "$letter" = "A" ]; then
+ # Convert 'A ' to './' so it matches
+ # the manifest file name.
+ path=`echo $file | sed 's/^A\s*/\.\//g'`
+ # Ignore directories
+ if [ ! -d $path ]; then
+ if (grep ^$path$ $MANIFEST >/dev/null); then
+ :
+ else
+ echo "+ $path"
+ fail=yes
+ fi
+ fi
+ 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.
-# I don't know what the official svn format is if such a specification exists.
-# Algorithm:
-# If the first line of the file has 'xml version="1.0"' in it, it is created
-# by svn 1.3 or older; else if it has '^file$' in it, it is created by svn 1.4.
-svn_entry_file=.svn/entries
-if head -1 $svn_entry_file | grep 'xml version="1.0"' > /dev/null 2>&1;then
- getsvnentries=GETSVNENTRIES_13
-elif grep '^file$' $svn_entry_file > /dev/null 2>&1; then
- getsvnentries=GETSVNENTRIES_14
-else
- echo "Unknown svn entries format. Aborted"
- exit 1
-fi
-
-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
- echo "+ $path/$file"
- fail=yes
- fi
- done
+# Next check svn ls, which gets a list of all files that are
+# checked in.
+svn_ls="$(svn ls -R)"
+for file in $svn_ls; do
+ path="./${file}"
+ # Ignore directories
+ if [ ! -d $path ]; then
+ if (grep ^$path$ $MANIFEST >/dev/null); then
+ :
+ else
+ echo "+ $path"
+ fail=yes
+ fi
+ fi
done
+# Finish up
if [ "X$fail" = "Xyes" ]; then
cat 1>&2 <<EOF
The MANIFEST is out of date. Files marked with a minus sign (-) no