From: Jim Meyering Date: Mon, 6 Feb 2017 18:03:04 +0000 (-0800) Subject: gnulib: update to latest; and tests/init.sh and bootstrap X-Git-Tag: v1.9~35 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;ds=sidebyside;h=00e60028b1d8e2ba97cb149ee8f8053febe59c94;p=debian%2Fgzip gnulib: update to latest; and tests/init.sh and bootstrap --- diff --git a/bootstrap b/bootstrap index 715c7ad..932ff85 100755 --- a/bootstrap +++ b/bootstrap @@ -1,6 +1,6 @@ #! /bin/sh # Print a version string. -scriptversion=2014-12-08.12; # UTC +scriptversion=2017-01-09.19; # UTC # Bootstrap this package from checked-out sources. @@ -42,7 +42,7 @@ export LC_ALL local_gl_dir=gl -# Honour $PERL, but work even if there is none +# Honor $PERL, but work even if there is none. PERL="${PERL-perl}" me=$0 @@ -418,28 +418,30 @@ sort_ver() { # sort -V is not generally available done } -get_version() { - app=$1 +get_version_sed=' +# Move version to start of line. +s/.*[v ]\([0-9]\)/\1/ - $app --version >/dev/null 2>&1 || { $app --version; return 1; } +# Skip lines that do not start with version. +/^[0-9]/!d - $app --version 2>&1 | - sed -n '# Move version to start of line. - s/.*[v ]\([0-9]\)/\1/ +# Remove characters after the version. +s/[^.a-z0-9-].*// - # Skip lines that do not start with version. - /^[0-9]/!d +# The first component must be digits only. +s/^\([0-9]*\)[a-z-].*/\1/ - # Remove characters after the version. - s/[^.a-z0-9-].*// +#the following essentially does s/5.005/5.5/ +s/\.0*\([1-9]\)/.\1/g +p +q' - # The first component must be digits only. - s/^\([0-9]*\)[a-z-].*/\1/ +get_version() { + app=$1 + + $app --version >/dev/null 2>&1 || { $app --version; return 1; } - #the following essentially does s/5.005/5.5/ - s/\.0*\([1-9]\)/.\1/g - p - q' + $app --version 2>&1 | sed -n "$get_version_sed" } check_versions() { @@ -788,7 +790,7 @@ symlink_to_dir() # Leave any existing symlink alone, if it already points to the source, # so that broken build tools that care about symlink times # aren't confused into doing unnecessary builds. Conversely, if the - # existing symlink's time stamp is older than the source, make it afresh, + # existing symlink's timestamp is older than the source, make it afresh, # so that broken tools aren't confused into skipping needed builds. See # . test -h "$dst" && @@ -1021,6 +1023,6 @@ echo "$0: done. Now you can run './configure'." # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/gnulib b/gnulib index a3fd683..b6acb8d 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit a3fd683de3decbb58ab5fb5d32ad2e62f74fbf12 +Subproject commit b6acb8db44af728e88a065526be035f7b927c0bf diff --git a/tests/init.sh b/tests/init.sh index 7637f3d..584194f 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -45,6 +45,9 @@ # Running a single test, with verbose output: # $ make check TESTS=test-foo.sh VERBOSE=yes # +# Running a single test, keeping the temporary directory: +# $ make check TESTS=test-foo.sh KEEP=yes +# # Running a single test, with single-stepping: # 1. Go into a sub-shell: # $ bash @@ -128,6 +131,13 @@ else fi # We require $(...) support unconditionally. +# We require non-surprising "local" semantics (this eliminates dash). +# This takes the admittedly draconian step of eliminating dash, because the +# assignment tab=$(printf '\t') works fine, yet preceding it with "local " +# transforms it into an assignment that sets the variable to the empty string. +# That is too counter-intuitive, and can lead to subtle run-time malfunction. +# The example below is less subtle in that with dash, it evokes the run-time +# exception "dash: 1: local: 1: bad variable name". # We require a few additional shell features only when $EXEEXT is nonempty, # in order to support automatic $EXEEXT emulation: # - hyphen-containing alias names @@ -151,6 +161,7 @@ fi gl_shell_test_script_=' test $(echo y) = y || exit 1 f_local_() { local v=1; }; f_local_ || exit 1 +f_dash_local_fail_() { local t=$(printf " 1"); }; f_dash_local_fail_ score_=10 if test "$VERBOSE" = yes; then test -n "$( (exec 3>&1; set -x; P=1 true 2>&3) 2> /dev/null)" && score_=9 @@ -287,50 +298,24 @@ compare_dev_null_ () return 2 } -if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null` \ - && diff -u Makefile "$0" 2>/dev/null | grep '^[+]#!' >/dev/null; then - # diff accepts the -u option and does not (like AIX 7 'diff') produce an - # extra space on column 1 of every content line. - if test -z "$diff_out_"; then - compare_ () { diff -u "$@"; } - else - compare_ () - { - if diff -u "$@" > diff.out; then - # No differences were found, but Solaris 'diff' produces output - # "No differences encountered". Hide this output. - rm -f diff.out - true - else - cat diff.out - rm -f diff.out - false - fi - } - fi -elif - for diff_opt_ in -U3 -c '' no; do - test "$diff_opt_" = no && break - diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" /dev/null; diff $diff_opt_ "$0" "$0" < /dev/null` && + break +done +if test "$diff_opt_" != no; then if test -z "$diff_out_"; then compare_ () { diff $diff_opt_ "$@"; } else compare_ () { - if diff $diff_opt_ "$@" > diff.out; then - # No differences were found, but AIX and HP-UX 'diff' produce output - # "No differences encountered" or "There are no differences between the - # files.". Hide this output. - rm -f diff.out - true - else - cat diff.out - rm -f diff.out - false - fi + # If no differences were found, AIX and HP-UX 'diff' produce output + # like "No differences encountered". Hide this output. + diff $diff_opt_ "$@" > diff.out + diff_status_=$? + test $diff_status_ -eq 0 || cat diff.out || diff_status_=2 + rm -f diff.out || diff_status_=2 + return $diff_status_ } fi elif cmp -s /dev/null /dev/null 2>/dev/null; then @@ -367,11 +352,15 @@ remove_tmp_ () { __st=$? cleanup_ - # cd out of the directory we're about to remove - cd "$initial_cwd_" || cd / || cd /tmp - chmod -R u+rwx "$test_dir_" - # If removal fails and exit status was to be 0, then change it to 1. - rm -rf "$test_dir_" || { test $__st = 0 && __st=1; } + if test "$KEEP" = yes; then + echo "Not removing temporary directory $test_dir_" + else + # cd out of the directory we're about to remove + cd "$initial_cwd_" || cd / || cd /tmp + chmod -R u+rwx "$test_dir_" + # If removal fails and exit status was to be 0, then change it to 1. + rm -rf "$test_dir_" || { test $__st = 0 && __st=1; } + fi exit $__st }