[iwhd] build: update gnulib submodule to latest
by Jim Meyering
commit d1169c6bfa00ab8a89c0069249bb5d52f47878b3
Author: Jim Meyering <meyering(a)redhat.com>
Date: Fri Jan 6 14:16:38 2012 +0100
build: update gnulib submodule to latest
gnulib | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gnulib b/gnulib
index 4e0358a..dc6246c 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 4e0358a6af54a597c5a3a8f7558a7e856758b141
+Subproject commit dc6246c5191f6228c7f3a33f56dc81c226868a99
12 years, 3 months
[iwhd] build: update bootstrap and init.sh from gnulib
by Jim Meyering
commit b3f1b9ef04ab7cd90242564920ab3a1cec35fccb
Author: Jim Meyering <meyering(a)redhat.com>
Date: Fri Jan 6 14:11:03 2012 +0100
build: update bootstrap and init.sh from gnulib
* t/init.sh: Update.
* bootstrap: Update, and do all of the following to accommodate:
* lib/Makefile.am: Initialize all of the following so that
generated code in gnulib.mk may use += to append to those variables:
AM_CFLAGS, AM_CPPFLAGS, BUILT_SOURCES, CLEANFILES, EXTRA_DIST,
MAINTAINERCLEANFILES, MOSTLYCLEANDIRS, MOSTLYCLEANFILES, SUFFIXES,
noinst_LIBRARIES.
* bootstrap.conf (gnulib_tool_option_extras): Remove use of $bt.
Remove unnecessary definition of gnulib_name:
gnulib_name=libiwhd is already the default
(gnulib_tool_option_extras): Specify --makefile-name=gnulib.mk to go
with new bootstrap script.
Also add --symlink.
* bootstrap.conf (bootstrap_epilogue): Remove vestigial rule.
No longer needed with latest bootstrap script.
* .gitignore.: Update
bootstrap | 341 +++++++++++++++++++----------------------------
bootstrap.conf | 12 +-
gnulib-tests/.gitignore | 3 +
lib/Makefile.am | 11 ++
t/init.sh | 119 +++++++++++++++--
5 files changed, 267 insertions(+), 219 deletions(-)
---
diff --git a/bootstrap b/bootstrap
index e9ec11e..66da981 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,10 +1,10 @@
#! /bin/sh
# Print a version string.
-scriptversion=2011-01-21.16; # UTC
+scriptversion=2012-01-06.07; # UTC
# Bootstrap this package from checked-out sources.
-# Copyright (C) 2003-2011 Free Software Foundation, Inc.
+# Copyright (C) 2003-2012 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -38,10 +38,6 @@ export LC_ALL
local_gl_dir=gl
-# Temporary directory names.
-bt='._bootmp'
-bt_regex=`echo "$bt"| sed 's/\./[.]/g'`
-bt2=${bt}2
me=$0
usage() {
@@ -88,6 +84,9 @@ gnulib_modules=
# Any gnulib files needed that are not in modules.
gnulib_files=
+: ${AUTOPOINT=autopoint}
+: ${AUTORECONF=autoreconf}
+
# A function to be called to edit gnulib.mk right after it's created.
# Override it via your own definition in bootstrap.conf.
gnulib_mk_hook() { :; }
@@ -105,6 +104,11 @@ po_download_command_format=\
"rsync --delete --exclude '*.s1' -Lrtvz \
'translationproject.org::tp/latest/%s/' '%s'"
+# Fallback for downloading .po files (if rsync fails).
+po_download_command_format2=\
+"wget --mirror -nd -q -np -A.po -P '%s' \
+ http://translationproject.org/latest/%s/"
+
extract_package_name='
/^AC_INIT(/{
/.*,.*,.*, */{
@@ -130,18 +134,7 @@ source_base=lib
m4_base=m4
doc_base=doc
tests_base=tests
-
-# Extra files from gnulib, which override files from other sources.
-gnulib_extra_files="
- $build_aux/install-sh
- $build_aux/missing
- $build_aux/mdate-sh
- $build_aux/texinfo.tex
- $build_aux/depcomp
- $build_aux/config.guess
- $build_aux/config.sub
- doc/INSTALL
-"
+gnulib_extra_files=''
# Additional gnulib-tool options to use. Use "\newline" to break lines.
gnulib_tool_option_extras=
@@ -229,6 +222,18 @@ case "$0" in
*) test -r "$0.conf" && . ./"$0.conf" ;;
esac
+# Extra files from gnulib, which override files from other sources.
+test -z "${gnulib_extra_files}" && \
+ gnulib_extra_files="
+ $build_aux/install-sh
+ $build_aux/missing
+ $build_aux/mdate-sh
+ $build_aux/texinfo.tex
+ $build_aux/depcomp
+ $build_aux/config.guess
+ $build_aux/config.sub
+ doc/INSTALL
+"
if test "$vc_ignore" = auto; then
vc_ignore=
@@ -278,14 +283,29 @@ if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
exit 1
fi
+# Ensure that lines starting with ! sort last, per gitignore conventions
+# for whitelisting exceptions after a more generic blacklist pattern.
+sort_patterns() {
+ sort -u "$@" | sed '/^!/ {
+ H
+ d
+ }
+ $ {
+ P
+ x
+ s/^\n//
+ }' | sed '/^$/d'
+}
+
# If $STR is not already on a line by itself in $FILE, insert it,
# sorting the new contents of the file and replacing $FILE with the result.
insert_sorted_if_absent() {
file=$1
str=$2
test -f $file || touch $file
- echo "$str" | sort -u - $file | cmp - $file > /dev/null \
- || echo "$str" | sort -u - $file -o $file \
+ echo "$str" | sort_patterns - $file | cmp - $file > /dev/null \
+ || { echo "$str" | sort_patterns - $file > $file.bak \
+ && mv $file.bak $file; } \
|| exit 1
}
@@ -296,8 +316,8 @@ insert_vc_ignore() {
pattern="$2"
case $vc_ignore_file in
*.gitignore)
- # A .gitignore entry that does not start with `/' applies
- # recursively to subdirectories, so prepend `/' to every
+ # A .gitignore entry that does not start with '/' applies
+ # recursively to subdirectories, so prepend '/' to every
# .gitignore entry.
pattern=`echo "$pattern" | sed s,^,/,`;;
esac
@@ -405,18 +425,32 @@ check_versions() {
# Honor $APP variables ($TAR, $AUTOCONF, etc.)
appvar=`echo $app | tr '[a-z]-' '[A-Z]_'`
test "$appvar" = TAR && appvar=AMTAR
- eval "app=\${$appvar-$app}"
- inst_ver=$(get_version $app)
- if [ ! "$inst_ver" ]; then
- echo "$me: Error: '$app' not found" >&2
- ret=1
- elif [ ! "$req_ver" = "-" ]; then
- latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2)
- if [ ! "$latest_ver" = "$inst_ver" ]; then
- echo "$me: Error: '$app' version == $inst_ver is too old" >&2
- echo " '$app' version >= $req_ver is required" >&2
+ case $appvar in
+ GZIP) ;; # Do not use $GZIP: it contains gzip options.
+ *) eval "app=\${$appvar-$app}" ;;
+ esac
+ if [ "$req_ver" = "-" ]; then
+ # Merely require app to exist; not all prereq apps are well-behaved
+ # so we have to rely on $? rather than get_version.
+ $app --version >/dev/null 2>&1
+ if [ 126 -le $? ]; then
+ echo "$me: Error: '$app' not found" >&2
ret=1
fi
+ else
+ # Require app to produce a new enough version string.
+ inst_ver=$(get_version $app)
+ if [ ! "$inst_ver" ]; then
+ echo "$me: Error: '$app' not found" >&2
+ ret=1
+ else
+ latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2)
+ if [ ! "$latest_ver" = "$inst_ver" ]; then
+ echo "$me: Error: '$app' version == $inst_ver is too old" >&2
+ echo " '$app' version >= $req_ver is required" >&2
+ ret=1
+ fi
+ fi
fi
done
@@ -443,6 +477,32 @@ if test $use_libtool = 1; then
find_tool LIBTOOLIZE glibtoolize libtoolize
fi
+# gnulib-tool requires at least automake and autoconf.
+# If either is not listed, add it (with minimum version) as a prerequisite.
+case $buildreq in
+ *automake*) ;;
+ *) buildreq="automake 1.9
+$buildreq" ;;
+esac
+case $buildreq in
+ *autoconf*) ;;
+ *) buildreq="autoconf 2.59
+$buildreq" ;;
+esac
+
+# When we can deduce that gnulib-tool will require patch,
+# and when patch is not already listed as a prerequisite, add it, too.
+if test ! -d "$local_gl_dir" \
+ || find "$local_gl_dir" -name '*.diff' -exec false {} +; then
+ :
+else
+ case $buildreq in
+ *patch*) ;;
+ *) buildreq="patch -
+$buildreq" ;;
+ esac
+fi
+
if ! printf "$buildreq" | check_versions; then
echo >&2
if test -f README-prereq; then
@@ -553,6 +613,9 @@ download_po_files() {
domain=$2
echo "$me: getting translations into $subdir for $domain..."
cmd=`printf "$po_download_command_format" "$domain" "$subdir"`
+ eval "$cmd" && return
+ # Fallback to HTTP.
+ cmd=`printf "$po_download_command_format2" "$subdir" "$domain"`
eval "$cmd"
}
@@ -640,10 +703,18 @@ symlink_to_dir()
cp -fp "$src" "$dst"
}
else
+ # 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,
+ # so that broken tools aren't confused into skipping needed builds. See
+ # <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00326.html>.
test -h "$dst" &&
src_ls=`ls -diL "$src" 2>/dev/null` && set $src_ls && src_i=$1 &&
dst_ls=`ls -diL "$dst" 2>/dev/null` && set $dst_ls && dst_i=$1 &&
- test "$src_i" = "$dst_i" || {
+ test "$src_i" = "$dst_i" &&
+ both_ls=`ls -dt "$src" "$dst"` &&
+ test "X$both_ls" = "X$dst$nl$src" || {
dot_dots=
case $src in
/*) ;;
@@ -665,56 +736,32 @@ symlink_to_dir()
}
}
-cp_mark_as_generated()
-{
- cp_src=$1
- cp_dst=$2
+# NOTE: we have to be careful to run both autopoint and libtoolize
+# before gnulib-tool, since gnulib-tool is likely to provide newer
+# versions of files "installed" by these two programs.
+# Then, *after* gnulib-tool (see below), we have to be careful to
+# run autoreconf in such a way that it does not run either of these
+# two just-pre-run programs.
- if cmp -s "$cp_src" "$GNULIB_SRCDIR/$cp_dst"; then
- symlink_to_dir "$GNULIB_SRCDIR" "$cp_dst"
- elif cmp -s "$cp_src" "$local_gl_dir/$cp_dst"; then
- symlink_to_dir $local_gl_dir "$cp_dst"
- else
- case $cp_dst in
- *.[ch]) c1='/* '; c2=' */';;
- *.texi) c1='@c '; c2= ;;
- *.m4|*/Make*|Make*) c1='# ' ; c2= ;;
- *) c1= ; c2= ;;
- esac
+# Import from gettext.
+with_gettext=yes
+grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
+ with_gettext=no
- # If the destination directory doesn't exist, create it.
- # This is required at least for "lib/uniwidth/cjk.h".
- dst_dir=`dirname "$cp_dst"`
- test -d "$dst_dir" || mkdir -p "$dst_dir"
-
- if test -z "$c1"; then
- cmp -s "$cp_src" "$cp_dst" || {
- # Copy the file first to get proper permissions if it
- # doesn't already exist. Then overwrite the copy.
- echo "$me: cp -f $cp_src $cp_dst" &&
- rm -f "$cp_dst" &&
- cp "$cp_src" "$cp_dst-t" &&
- sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst-t" &&
- mv -f "$cp_dst-t" "$cp_dst"
- }
- else
- # Copy the file first to get proper permissions if it
- # doesn't already exist. Then overwrite the copy.
- cp "$cp_src" "$cp_dst-t" &&
- (
- echo "$c1-*- buffer-read-only: t -*- vi: set ro:$c2" &&
- echo "${c1}DO NOT EDIT! GENERATED AUTOMATICALLY!$c2" &&
- sed "s!$bt_regex/!!g" "$cp_src"
- ) > $cp_dst-t &&
- if cmp -s "$cp_dst-t" "$cp_dst"; then
- rm -f "$cp_dst-t"
- else
- echo "$me: cp $cp_src $cp_dst # with edits" &&
- mv -f "$cp_dst-t" "$cp_dst"
- fi
- fi
- fi
-}
+if test $with_gettext = yes; then
+ # Released autopoint has the tendency to install macros that have been
+ # obsoleted in current gnulib, so run this before gnulib-tool.
+ echo "$0: $AUTOPOINT --force"
+ $AUTOPOINT --force || exit
+fi
+
+# Autoreconf runs aclocal before libtoolize, which causes spurious
+# warnings if the initial aclocal is confused by the libtoolized
+# (or worse out-of-date) macro directory.
+if grep '^[ ]*LT_INIT' configure.ac >/dev/null; then
+ echo "running: $LIBTOOLIZE --copy --install"
+ $LIBTOOLIZE --copy --install
+fi
version_controlled_file() {
dir=$1
@@ -733,96 +780,17 @@ version_controlled_file() {
test $found = yes
}
-slurp() {
- for dir in . `(cd $1 && find * -type d -print)`; do
- copied=
- sep=
- for file in `ls -a $1/$dir`; do
- case $file in
- .|..) continue;;
- # FIXME: should all file names starting with "." be ignored?
- .*) continue;;
- esac
- test -d $1/$dir/$file && continue
- for excluded_file in $excluded_files; do
- test "$dir/$file" = "$excluded_file" && continue 2
- done
- if test $file = Makefile.am && test "X$gnulib_mk" != XMakefile.am; then
- copied=$copied${sep}$gnulib_mk; sep=$nl
- remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g"
- sed "$remove_intl" $1/$dir/$file |
- cmp - $dir/$gnulib_mk > /dev/null || {
- echo "$me: Copying $1/$dir/$file to $dir/$gnulib_mk ..." &&
- rm -f $dir/$gnulib_mk &&
- sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk &&
- gnulib_mk_hook $dir/$gnulib_mk
- }
- elif { test "${2+set}" = set && test -r $2/$dir/$file; } ||
- version_controlled_file $dir $file; then
- echo "$me: $dir/$file overrides $1/$dir/$file"
- else
- copied=$copied$sep$file; sep=$nl
- if test $file = gettext.m4; then
- echo "$me: patching m4/gettext.m4 to remove need for intl/* ..."
- rm -f $dir/$file
- sed '
- /^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
- AC_DEFUN([AM_INTL_SUBDIR], [])
- /^AC_DEFUN(\[gt_INTL_SUBDIR_CORE],/,/^]/c\
- AC_DEFUN([gt_INTL_SUBDIR_CORE], [])
- $a\
- AC_DEFUN([gl_LOCK_EARLY], [])
- ' $1/$dir/$file >$dir/$file
- else
- cp_mark_as_generated $1/$dir/$file $dir/$file
- fi
- fi || exit
- done
-
- for dot_ig in x $vc_ignore; do
- test $dot_ig = x && continue
- ig=$dir/$dot_ig
- if test -n "$copied"; then
- insert_vc_ignore $ig "$copied"
- # If an ignored file name ends with .in.h, then also add
- # the name with just ".h". Many gnulib headers are generated,
- # e.g., stdint.in.h -> stdint.h, dirent.in.h ->..., etc.
- # Likewise for .gperf -> .h, .y -> .c, and .sin -> .sed
- f=`echo "$copied" |
- sed '
- s/\.in\.h$/.h/
- s/\.sin$/.sed/
- s/\.y$/.c/
- s/\.gperf$/.h/
- '
- `
- insert_vc_ignore $ig "$f"
-
- # For files like sys_stat.in.h and sys_time.in.h, record as
- # ignorable the directory we might eventually create: sys/.
- f=`echo "$copied"|sed 's/sys_.*\.in\.h$/sys/'`
- insert_vc_ignore $ig "$f"
- fi
- done
- done
-}
-
-
-# Create boot temporary directories to import from gnulib and gettext.
-rm -fr $bt $bt2 &&
-mkdir $bt $bt2 || exit
-
# Import from gnulib.
gnulib_tool_options="\
--import\
--no-changelog\
- --aux-dir $bt/$build_aux\
- --doc-base $bt/$doc_base\
+ --aux-dir $build_aux\
+ --doc-base $doc_base\
--lib $gnulib_name\
- --m4-base $bt/$m4_base/\
- --source-base $bt/$source_base/\
- --tests-base $bt/$tests_base\
+ --m4-base $m4_base/\
+ --source-base $source_base/\
+ --tests-base $tests_base\
--local-dir $local_gl_dir\
$gnulib_tool_option_extras\
"
@@ -834,26 +802,11 @@ if test $use_libtool = 1; then
fi
echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
$gnulib_tool $gnulib_tool_options --import $gnulib_modules &&
-slurp $bt || exit
for file in $gnulib_files; do
symlink_to_dir "$GNULIB_SRCDIR" $file || exit
done
-
-# Import from gettext.
-with_gettext=yes
-grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
- with_gettext=no
-
-if test $with_gettext = yes; then
- echo "$0: (cd $bt2; ${AUTOPOINT-autopoint}) ..."
- cp configure.ac $bt2 &&
- (cd $bt2 && ${AUTOPOINT-autopoint} && rm configure.ac) &&
- slurp $bt2 $bt || exit
-fi
-rm -fr $bt $bt2 || exit
-
# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
# gnulib-populated directories. Such .m4 files would cause aclocal to fail.
# The following requires GNU find 4.2.3 or newer. Considering the usual
@@ -866,28 +819,12 @@ find "$m4_base" "$source_base" \
-depth \( -name '*.m4' -o -name '*.[ch]' \) \
-type l -xtype l -delete > /dev/null 2>&1
-# Reconfigure, getting other files.
-
-# Skip autoheader if it's not needed.
-grep -E '^[ ]*AC_CONFIG_HEADERS?\>' configure.ac >/dev/null ||
- AUTOHEADER=true
-
-for command in \
- libtool \
- "${ACLOCAL-aclocal} --force -I m4 $ACLOCAL_FLAGS" \
- "${AUTOCONF-autoconf} --force" \
- "${AUTOHEADER-autoheader} --force" \
- "${AUTOMAKE-automake} --add-missing --copy --force-missing"
-do
- if test "$command" = libtool; then
- test $use_libtool = 0 \
- && continue
- command="${LIBTOOLIZE-libtoolize} -c -f"
- fi
- echo "$0: $command ..."
- $command || exit
-done
-
+# Tell autoreconf not to invoke autopoint or libtoolize; they were run above.
+echo "running: AUTOPOINT=true LIBTOOLIZE=true " \
+ "$AUTORECONF --verbose --install --no-recursive -I $m4_base $ACLOCAL_FLAGS"
+AUTOPOINT=true LIBTOOLIZE=true \
+ $AUTORECONF --verbose --install --no-recursive -I $m4_base $ACLOCAL_FLAGS \
+ || exit 1
# Get some extra files from gnulib, overriding existing files.
for file in $gnulib_extra_files; do
diff --git a/bootstrap.conf b/bootstrap.conf
index 6b3702e..3460166 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -81,8 +81,6 @@ xstrtoumax
xvasprintf
'
-gnulib_name=libiwhd
-
checkout_only_file=
MSGID_BUGS_ADDRESS=iwhd-devel(a)fedorahosted.org
@@ -98,7 +96,10 @@ XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
# Automake requires that ChangeLog exist.
test -f ChangeLog || touch ChangeLog || exit 1
-gnulib_tool_option_extras="--tests-base=$bt/gnulib-tests --with-tests $avoided_gnulib_modules"
+gnulib_tool_option_extras="--tests-base=gnulib-tests --with-tests\
+ --symlink --makefile-name=gnulib.mk\
+ $avoided_gnulib_modules
+"
# Build prerequisites
buildreq="\
@@ -117,11 +118,6 @@ tar -
bootstrap_epilogue()
{
- # Change paths in gnulib-tests/gnulib.mk from "../.." to "..".
- m=gnulib-tests/gnulib.mk
- sed 's,\.\./\.\.,..,g' $m > $m-t
- mv -f $m-t $m
-
m=po/Makefile.in.in
chmod u+w $m
diff --git a/gnulib-tests/.gitignore b/gnulib-tests/.gitignore
index bb0ffeb..eef2365 100644
--- a/gnulib-tests/.gitignore
+++ b/gnulib-tests/.gitignore
@@ -387,3 +387,6 @@ vasnprintf.h
wctob.c
xsize.h
zerosize-ptr.h
+/test-init.sh
+/test-strtoul.c
+/test-strtoull.c
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 54f5491..124c9c5 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -15,6 +15,17 @@
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
+AM_CFLAGS =
+AM_CPPFLAGS =
+BUILT_SOURCES =
+CLEANFILES =
+EXTRA_DIST =
+MAINTAINERCLEANFILES =
+MOSTLYCLEANDIRS =
+MOSTLYCLEANFILES =
+SUFFIXES =
+noinst_LIBRARIES =
+
include gnulib.mk
AM_CFLAGS += $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
diff --git a/t/init.sh b/t/init.sh
index 0da6c1e..5985552 100644
--- a/t/init.sh
+++ b/t/init.sh
@@ -1,6 +1,6 @@
# source this file; set up for tests
-# Copyright (C) 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 2009-2012 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -61,7 +61,7 @@ ME_=`expr "./$0" : '.*/\(.*\)$'`
# We use a trap below for cleanup. This requires us to go through
# hoops to get the right exit status transported through the handler.
-# So use `Exit STATUS' instead of `exit STATUS' inside of the tests.
+# So use 'Exit STATUS' instead of 'exit STATUS' inside of the tests.
# Turn off errexit here so that we don't trip the bug with OSF1/Tru64
# sh inside this function.
Exit () { set +e; (exit $1); exit $1; }
@@ -74,7 +74,20 @@ Exit () { set +e; (exit $1); exit $1; }
# the reason for skip/failure to console, rather than to the .log files.
: ${stderr_fileno_=2}
-warn_ () { echo "$@" 1>&$stderr_fileno_; }
+# Note that correct expansion of "$*" depends on IFS starting with ' '.
+# Always write the full diagnostic to stderr.
+# When stderr_fileno_ is not 2, also emit the first line of the
+# diagnostic to that file descriptor.
+warn_ ()
+{
+ # If IFS does not start with ' ', set it and emit the warning in a subshell.
+ case $IFS in
+ ' '*) printf '%s\n' "$*" >&2
+ test $stderr_fileno_ = 2 \
+ || { printf '%s\n' "$*" | sed 1q >&$stderr_fileno_ ; } ;;
+ *) (IFS=' '; warn_ "$@");;
+ esac
+}
fail_ () { warn_ "$ME_: failed test: $@"; Exit 1; }
skip_ () { warn_ "$ME_: skipped test: $@"; Exit 77; }
fatal_ () { warn_ "$ME_: hard error: $@"; Exit 99; }
@@ -159,7 +172,7 @@ else
if test "$re_shell_" = __current__; then
# 'eval'ing this code makes Solaris 10's /bin/sh exit with
# $? set to 2. It does not evaluate any of the code after the
- # "unexpected" first `('. Thus, we must run it in a subshell.
+ # "unexpected" first '('. Thus, we must run it in a subshell.
( eval "$gl_shell_test_script_" ) > /dev/null 2>&1
else
"$re_shell_" -c "$gl_shell_test_script_" 2>/dev/null
@@ -208,14 +221,102 @@ export MALLOC_PERTURB_
# a partition, or to undo any other global state changes.
cleanup_ () { :; }
-if ( diff --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
- compare () { diff -u "$@"; }
+# Emit a header similar to that from diff -u; Print the simulated "diff"
+# command so that the order of arguments is clear. Don't bother with @@ lines.
+emit_diff_u_header_ ()
+{
+ printf '%s\n' "diff -u $*" \
+ "--- $1 1970-01-01" \
+ "+++ $2 1970-01-01"
+}
+
+# Arrange not to let diff or cmp operate on /dev/null,
+# since on some systems (at least OSF/1 5.1), that doesn't work.
+# When there are not two arguments, or no argument is /dev/null, return 2.
+# When one argument is /dev/null and the other is not empty,
+# cat the nonempty file to stderr and return 1.
+# Otherwise, return 0.
+compare_dev_null_ ()
+{
+ test $# = 2 || return 2
+
+ if test "x$1" = x/dev/null; then
+ test -s "$2" || return 0
+ emit_diff_u_header_ "$@"; sed 's/^/+/' "$2"
+ return 1
+ fi
+
+ if test "x$2" = x/dev/null; then
+ test -s "$1" || return 0
+ emit_diff_u_header_ "$@"; sed 's/^/-/' "$1"
+ return 1
+ fi
+
+ return 2
+}
+
+if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null`; then
+ 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 diff_out_=`exec 2>/dev/null; diff -c "$0" "$0" < /dev/null`; then
+ if test -z "$diff_out_"; then
+ compare_ () { diff -c "$@"; }
+ else
+ compare_ ()
+ {
+ if diff -c "$@" > 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
+ }
+ fi
elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
- compare () { cmp -s "$@"; }
+ compare_ () { cmp -s "$@"; }
else
- compare () { cmp "$@"; }
+ compare_ () { cmp "$@"; }
fi
+# Usage: compare EXPECTED ACTUAL
+#
+# Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more.
+# Otherwise, propagate $? to caller: any diffs have already been printed.
+compare ()
+{
+ # This looks like it can be factored to use a simple "case $?"
+ # after unchecked compare_dev_null_ invocation, but that would
+ # fail in a "set -e" environment.
+ if compare_dev_null_ "$@"; then
+ return 0
+ else
+ case $? in
+ 1) return 1;;
+ *) compare_ "$@";;
+ esac
+ fi
+}
+
# An arbitrary prefix to help distinguish test directories.
testdir_prefix_ () { printf gt; }
@@ -426,7 +527,7 @@ mktempd_ ()
esac
# First, try to use mktemp.
- d=`unset TMPDIR; mktemp -d -t -p "$destdir_" "$template_" 2>/dev/null` \
+ d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` \
|| fail=1
# The resulting name must be in the specified directory.
12 years, 3 months
[iwhd] maint: update copyright year numbers
by Jim Meyering
commit 3fc89b2fb3affb7c288d07baa2c44e3a877be6e7
Author: Jim Meyering <meyering(a)redhat.com>
Date: Fri Jan 6 14:14:24 2012 +0100
maint: update copyright year numbers
Include 2012 in copyright date year lists for Red Hat, Inc.
and for the Free Software Foundation, Inc.
Makefile.am | 2 +-
README-hacking | 2 +-
backend.c | 2 +-
backend.h | 2 +-
bootstrap.conf | 2 +-
cfg.mk | 2 +-
configure.ac | 2 +-
dc-condor-image | 2 +-
dc-register-image | 2 +-
dc-rhev-image.c | 2 +-
dc-vmware-image.c | 2 +-
iwh.h | 2 +-
lib/Makefile.am | 2 +-
logging.c | 2 +-
logging.h | 2 +-
man/Makefile.am | 2 +-
meta.cpp | 2 +-
meta.h | 2 +-
mpipe.c | 2 +-
mpipe.h | 2 +-
query.h | 2 +-
replica.c | 2 +-
replica.h | 2 +-
rest.c | 2 +-
setup.c | 2 +-
setup.h | 2 +-
state_defs.h | 2 +-
t/Makefile.am | 2 +-
t/hoa.h | 2 +-
t/hstor.c | 2 +-
t/poke.c | 2 +-
template.c | 2 +-
template.h | 2 +-
user.c | 2 +-
user.h | 2 +-
35 files changed, 35 insertions(+), 35 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index a7cfa19..5d70ce3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2010-2011 Red Hat, Inc.
+# Copyright (C) 2010-2012 Red Hat, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/README-hacking b/README-hacking
index 6eecd24..7369f2d 100644
--- a/README-hacking
+++ b/README-hacking
@@ -94,7 +94,7 @@ each program. One way to do this is to use vc-dwim
-----
-Copyright (C) 2002-2011 Free Software Foundation, Inc.
+Copyright (C) 2002-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/backend.c b/backend.c
index 3d849f5..ed61c79 100644
--- a/backend.c
+++ b/backend.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/backend.h b/backend.h
index cc44668..a293551 100644
--- a/backend.h
+++ b/backend.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/bootstrap.conf b/bootstrap.conf
index 5ec9611..6b3702e 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -1,6 +1,6 @@
# Bootstrap configuration.
-# Copyright (C) 2006-2011 Free Software Foundation, Inc.
+# Copyright (C) 2006-2012 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cfg.mk b/cfg.mk
index 571274f..875376a 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1,5 +1,5 @@
# Customize maint.mk -*- makefile -*-
-# Copyright (C) 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 2009-2012 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/configure.ac b/configure.ac
index 2c11bb4..ad9d53d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-# Copyright (C) 1991, 1993-2011 Red Hat, Inc.
+# Copyright (C) 1991, 1993-2012 Red Hat, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/dc-condor-image b/dc-condor-image
index 4f91435..5469915 100755
--- a/dc-condor-image
+++ b/dc-condor-image
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright (C) 2010-2011 Red Hat, Inc.
+# Copyright (C) 2010-2012 Red Hat, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/dc-register-image b/dc-register-image
index 0e9ed18..e880234 100755
--- a/dc-register-image
+++ b/dc-register-image
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright (C) 2010-2011 Red Hat, Inc.
+# Copyright (C) 2010-2012 Red Hat, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/dc-rhev-image.c b/dc-rhev-image.c
index 99d2b8b..ee2b5d3 100644
--- a/dc-rhev-image.c
+++ b/dc-rhev-image.c
@@ -1,6 +1,6 @@
/*
* dc-rhev-image: register an image in RHEV
- * Copyright (C) 2011 Red Hat, Inc.
+ * Copyright (C) 2011-2012 Red Hat, Inc.
*
* The URL parser is taken from GNet (by way of tabled):
*
diff --git a/dc-vmware-image.c b/dc-vmware-image.c
index 9fbe6a3..ea617fd 100644
--- a/dc-vmware-image.c
+++ b/dc-vmware-image.c
@@ -1,6 +1,6 @@
/*
* dc-vmware-image: register an image in vSphere
- * Copyright (C) 2011 Red Hat, Inc.
+ * Copyright (C) 2011-2012 Red Hat, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/iwh.h b/iwh.h
index 29b8ee0..2a3f278 100644
--- a/iwh.h
+++ b/iwh.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 4325180..54f5491 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,6 +1,6 @@
## Makefile for gnulib/lib -*-Makefile-*-
-# Copyright (C) 1995-2007, 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 1995-2007, 2009-2012 Free Software Foundation, Inc.
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
diff --git a/logging.c b/logging.c
index 6e2a913..1a13c1d 100644
--- a/logging.c
+++ b/logging.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/logging.h b/logging.h
index fb82515..6eca57b 100644
--- a/logging.h
+++ b/logging.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/man/Makefile.am b/man/Makefile.am
index f7a5fa6..e9024ba 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,6 +1,6 @@
# Automakefile for GNU diffutils man pages
-# Copyright (C) 2002, 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2009-2012 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/meta.cpp b/meta.cpp
index 36c082b..1729088 100644
--- a/meta.cpp
+++ b/meta.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/meta.h b/meta.h
index bee8317..e39f79d 100644
--- a/meta.h
+++ b/meta.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/mpipe.c b/mpipe.c
index 3d17d5d..51287a3 100644
--- a/mpipe.c
+++ b/mpipe.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/mpipe.h b/mpipe.h
index 28bcbc5..35ce017 100644
--- a/mpipe.h
+++ b/mpipe.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/query.h b/query.h
index e9f83d1..fea513c 100644
--- a/query.h
+++ b/query.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/replica.c b/replica.c
index 0f66786..e9855cc 100644
--- a/replica.c
+++ b/replica.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/replica.h b/replica.h
index 971f060..6b21ad5 100644
--- a/replica.h
+++ b/replica.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/rest.c b/rest.c
index 5dee8d7..1aca0af 100644
--- a/rest.c
+++ b/rest.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/setup.c b/setup.c
index a81477d..bd3a7ab 100644
--- a/setup.c
+++ b/setup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/setup.h b/setup.h
index f55f1f3..fb7bc60 100644
--- a/setup.h
+++ b/setup.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/state_defs.h b/state_defs.h
index ff3e8ec..6b09c55 100644
--- a/state_defs.h
+++ b/state_defs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/t/Makefile.am b/t/Makefile.am
index 1f0e404..77094b9 100644
--- a/t/Makefile.am
+++ b/t/Makefile.am
@@ -1,5 +1,5 @@
## Process this file with automake to create Makefile.in
-# Copyright 2010-2011 Red Hat, Inc.
+# Copyright 2010-2012 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/t/hoa.h b/t/hoa.h
index 609bb7d..6004dcf 100644
--- a/t/hoa.h
+++ b/t/hoa.h
@@ -2,7 +2,7 @@
#define _HSTOR_H
/*
- * Copyright 2008-2011 Red Hat, Inc.
+ * Copyright 2008-2012 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/t/hstor.c b/t/hstor.c
index ab82ec4..e273382 100644
--- a/t/hstor.c
+++ b/t/hstor.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2008-2011 Red Hat, Inc.
+ * Copyright 2008-2012 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/t/poke.c b/t/poke.c
index 8e307dc..1f40415 100644
--- a/t/poke.c
+++ b/t/poke.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Red Hat, Inc.
+ * Copyright 2011-2012 Red Hat, Inc.
*
* Test for authorized iwhd.
* If curl(1) supported OAuth, we would not need this.
diff --git a/template.c b/template.c
index a4fcb80..37a6012 100644
--- a/template.c
+++ b/template.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/template.h b/template.h
index 325c0c4..5e26590 100644
--- a/template.h
+++ b/template.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/user.c b/user.c
index ba07050..566ce6c 100644
--- a/user.c
+++ b/user.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 Red Hat, Inc.
+/* Copyright (C) 2010-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/user.h b/user.h
index becb518..1d8366d 100644
--- a/user.h
+++ b/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Red Hat, Inc.
+/* Copyright (C) 2011-2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
12 years, 3 months
[iwhd] tests: update testing framework to work with upcoming automake-1.12
by Jim Meyering
commit fe52275ec2546f42fedb650871c15f364e737c66
Author: Jim Meyering <meyering(a)redhat.com>
Date: Fri Jan 6 12:21:48 2012 +0100
tests: update testing framework to work with upcoming automake-1.12
* t/Makefile.am (TESTS_ENVIRONMENT): Update to work with
upcoming automake-1.12.
* t/auto: Make executable.
* t/basic: Likewise.
* t/delete-missing: Likewise.
* t/oauth: Likewise.
* t/provider: Likewise.
* t/registration: Likewise.
* t/replication: Likewise.
t/Makefile.am | 17 +----------------
1 files changed, 1 insertions(+), 16 deletions(-)
---
diff --git a/t/Makefile.am b/t/Makefile.am
index 529e188..1f0e404 100644
--- a/t/Makefile.am
+++ b/t/Makefile.am
@@ -55,21 +55,6 @@ EXTRA_DIST = \
TESTS_ENVIRONMENT = \
tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.; \
TMPDIR=$$tmp__; export TMPDIR; \
- shell_or_perl_() { \
- if grep '^\#!/usr/bin/perl' "$$1" > /dev/null; then \
- if $(PERL) -e 'use warnings' > /dev/null 2>&1; then \
- grep '^\#!/usr/bin/perl -T' "$$1" > /dev/null && T_=T || T_=; \
- $(PERL) -w$$T_ -I$(srcdir) -MCoreutils \
- -M"CuTmpdir qw($$f)" -- "$$1"; \
- else \
- echo 1>&2 "$$tst: configure did not find a usable version of Perl," \
- "so skipping this test"; \
- (exit 77); \
- fi; \
- else \
- $(SHELL) "$$1"; \
- fi; \
- }; \
export \
LC_ALL=C \
VERSION=$(VERSION) \
@@ -88,4 +73,4 @@ TESTS_ENVIRONMENT = \
PERL='$(PERL)' \
SHELL='$(SHELL)' \
PATH='$(abs_top_builddir)$(PATH_SEPARATOR)'"$$PATH" \
- ; shell_or_perl_ 9>&2
+ ; 9>&2
diff --git a/t/auto b/t/auto
old mode 100644
new mode 100755
diff --git a/t/basic b/t/basic
old mode 100644
new mode 100755
diff --git a/t/delete-missing b/t/delete-missing
old mode 100644
new mode 100755
diff --git a/t/oauth b/t/oauth
old mode 100644
new mode 100755
diff --git a/t/provider b/t/provider
old mode 100644
new mode 100755
diff --git a/t/registration b/t/registration
old mode 100644
new mode 100755
diff --git a/t/replication b/t/replication
old mode 100644
new mode 100755
12 years, 3 months