diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2015-03-06 05:13:47 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2015-03-06 05:13:47 (GMT) |
commit | 76d509dd6f454de8b01d0116dc73e56ea5949aa8 (patch) | |
tree | bd3291ac545e0ab332624aed7b6435899b13d4ef /bin | |
parent | 50c38a5733bf39c2ba2cdb0de4d03e4aa78b1814 (diff) | |
download | hdf5-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')
-rwxr-xr-x | bin/chkmanifest | 136 | ||||
-rwxr-xr-x | bin/trace | 20 |
2 files changed, 56 insertions, 100 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 @@ -118,7 +118,8 @@ $Source = ""; "H5G_iterate_t" => "x", "H5G_info_t" => "x", "H5I_free_t" => "x", - "H5L_class_t" => "x", + "H5I_search_func_t" => "x", + "H5L_class_t" => "x", "H5L_elink_traverse_t" => "x", "H5L_iterate_t" => "x", "H5MM_allocate_t" => "x", @@ -281,14 +282,10 @@ sub rewrite_func ($$$$$) { # The H5TRACE() statement if ($body =~ /\/\*[ \t]*NO[ \t]*TRACE[ \t]*\*\//) { - if ($body =~ /\s*H5TRACE\d+\s*\(/) { - errmesg $file, $name, "warning: trace info was not updated because of NO TRACE comment"; - } else { - errmesg $file, $name, "warning: trace info was not inserted because of NO TRACE comment"; - } + # Ignored due to NO TRACE comment. } elsif ($body =~ s/((\n[ \t]*)H5TRACE\d+\s*\(.*?\);)\n/"$2$trace"/es) { - # Replaced an H5TRACE macro - } elsif ($body=~s/((\n[ \t]*)FUNC_ENTER\w*\s*\(.*?\);??)\n/"$1$2$trace"/es) { + # Replaced an H5TRACE macro. + } elsif ($body=~s/((\n[ \t]*)FUNC_ENTER\w*\s*(\(.*?\))?;??)\n/"$1$2$trace"/es) { # Added an H5TRACE macro after a FUNC_ENTER macro. } else { errmesg $file, $name, "unable to insert tracing information"; @@ -317,14 +314,14 @@ for $file (@ARGV) { # Make modifications my $original = $Source; - my $napi = $Source =~ s/\n([A-Za-z]\w*(\s+[a-z]\w*)*)\s*\n #type + my $napi = $Source =~ s/\n([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**)\n #type (H5[A-Z]{0,2}[^_A-Z0-9]\w*) #name \s*\((.*?)\)\s* #args (\{.*?\n\}[^\n]*) #body /rewrite_func($file,$1,$3,$4,$5)/segx; $total_api += $napi; - # If the source changed then print out the new version +# If the source changed then print out the new version if ($original ne $Source) { printf "%s: instrumented %d API function%s\n", $file, $napi, 1==$napi?"":"s"; @@ -335,3 +332,6 @@ for $file (@ARGV) { } } } + +printf "Finished processing HDF5 API calls\n" + |