diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2016-09-16 11:02:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-16 11:02:28 -0400 |
commit | 811f0ec54c98172bbde655cc9399a0919b1c733a (patch) | |
tree | 041f4e42ec70e28926e7f1a440b42d874735c84c /dist | |
parent | 03bbd9d3c9330a5b6e3cbd7d2db1ac7fea5e96bf (diff) | |
download | mongo-811f0ec54c98172bbde655cc9399a0919b1c733a.tar.gz |
WT-2918 the dist scripts create C files s_whitespace complains about (#3048)
* WT-2918 the dist scripts create C files s_whitespace complains about
s_export doesn't need to create a .c file.
enhance a comment to explain the loop.
* The s_tags script creates a .c file that s_whitespace doesn't like,
use a standard source file for the ctags flag test.
At the end of the script, remove the tags file created in the dist
directory.
Include source files deeper than 1 directory below src/ so we get
src/checksum/XXX.
Don't redirect the "skipping ctags" message to the tags file, that
means it never gets seen.
* Fixing the bug that kept the s_tags "skipped" message from showing
up broke s_all, add s_tags to the exclusion list.
* Don't overwrite the local tags file if we're run in the wrong directory.
Exit 0 on success, 1 on error.
Diffstat (limited to 'dist')
-rwxr-xr-x | dist/s_all | 2 | ||||
-rwxr-xr-x | dist/s_export | 8 | ||||
-rwxr-xr-x | dist/s_tags | 45 |
3 files changed, 30 insertions, 25 deletions
diff --git a/dist/s_all b/dist/s_all index 33b8f6a76ba..064c443ce47 100755 --- a/dist/s_all +++ b/dist/s_all @@ -56,7 +56,7 @@ errchk() # Some tests shouldn't return an error, we exclude them here. case "$1" in - *s_export*) + *s_export|*s_tags) break;; *) errfound=1;; diff --git a/dist/s_export b/dist/s_export index 94242e0118d..874d9c5f8bf 100755 --- a/dist/s_export +++ b/dist/s_export @@ -2,7 +2,7 @@ # Check for illegal external symbols. # -t=__a.c +t=__wt.$$ trap 'rm -f $t; exit 0' 0 1 2 3 13 15 case `uname` in @@ -40,8 +40,10 @@ check() } # This check would normally be done after the library is built, but this way -# we don't forget about a symbol during development. Check the previously -# built library, if it exists. +# we don't forget about a symbol during development. We usually build in the +# top-level or build_posix directories, check the previously built library, +# if it exists. And, allow this script to be run from the top-level directory +# as well as locally. for d in .libs build_posix/.libs; do f="$d/libwiredtiger.a" test -f $f && check $f diff --git a/dist/s_tags b/dist/s_tags index faed132d05b..edb1567992c 100755 --- a/dist/s_tags +++ b/dist/s_tags @@ -1,41 +1,43 @@ #! /bin/sh -# Build tags file. -# -t=__a.c -trap 'rm -f $t; exit 0' 0 1 2 3 13 15 +# Build tags files. +trap 'rm -f tags' 0 1 2 3 13 15 # Skip this when building release packages test -n "$WT_RELEASE_BUILD" && exit 0 +# We have to be in the dist directory to run. +test -f s_tags || { + echo "s_tags requires dist be the current working directory" + exit 1 +} + # We require ctags which may not be installed. type ctags > /dev/null 2>&1 || { - echo 'skipped: ctags not found' > $t + echo 'skipped: ctags not found' exit 0 } # Test to see what flags this ctags binary supports. -# Use the -d, -t and -w flags to ctags if available. flags="" -echo "f() { int a; }" > $t for i in -d -t -w --language-force=C; do - if ctags $i $t 2>/dev/null; then + if ctags $i ../src/conn/api_strerror.c 2>/dev/null; then flags="$i $flags" fi done -# Generate a tags file for the build directory -(cd ../build_posix -rm -f tags -ctags $flags ../src/include/*.in ../src/*/*.[chi] 2>/dev/null) +# Generate a tags file for the standard build directory. +(cd ../build_posix && +rm -f tags && +ctags $flags ../src/include/*.in `find ../src -name '*.[chi]'` 2>/dev/null) -# Put the shared tags file in the include directory, it's at the same level in -# the tree as the other source files. -(cd ../src/include -rm -f tags -ctags $flags ../include/*.in ../*/*.[chi] 2>/dev/null) +# Generate a tags file for the src/include directory. +(cd ../src/include && +rm -f tags && +ctags $flags ../include/*.in `find .. -name '*.[chi]'` 2>/dev/null) -# Link the tags file into place if we're at the right level. +# Link the tags file into place in the standard source directories, if we're +# at the right level. link_tag() { if test -e ../include/tags; then @@ -46,8 +48,9 @@ link_tag() # Link to the tags file from standard build and source directories. dirs="`python -c 'import dist; dist.print_source_dirs()'` ../src/os_win" for i in $dirs; do - if expr "$i" : ".*/include" > /dev/null; then - continue - fi + expr "$i" : ".*/include" > /dev/null && continue + (cd $i && link_tag) done + +exit 0 |