[iwhd] build: update gnulib submodule to latest
by Jim Meyering
commit d923e798b89946b0766e20655cf59f1bb4ad1e9f
Author: Jim Meyering <meyering(a)redhat.com>
Date: Thu Aug 30 15:33:13 2012 +0200
build: update gnulib submodule to latest
gnulib | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gnulib b/gnulib
index eb872c4..1af55d8 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit eb872c43a7bfea71a5a3bb95b6817cc3d7c0966f
+Subproject commit 1af55d85d9762a679b4302d5995f05ccd883e956
11 years, 7 months
[iwhd] maint: post-release administrivia
by Jim Meyering
commit 6c0fdd72298be29bc8eb569f8b15da88f1c1e263
Author: Jim Meyering <meyering(a)redhat.com>
Date: Wed Aug 22 07:16:10 2012 +0200
maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
.prev-version | 2 +-
NEWS | 3 +++
cfg.mk | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/.prev-version b/.prev-version
index c239c60..810ee4e 100644
--- a/.prev-version
+++ b/.prev-version
@@ -1 +1 @@
-1.5
+1.6
diff --git a/NEWS b/NEWS
index 5b50a99..ab86abd 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
iwhd NEWS -*- outline -*-
+* Noteworthy changes in release ?.? (????-??-??) [?]
+
+
* Noteworthy changes in release 1.6 (2012-08-22) [stable]
** Infrastructure
diff --git a/cfg.mk b/cfg.mk
index 179bd4e..b4c99b3 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -38,7 +38,7 @@ bootstrap-tools = autoconf,automake,gnulib
# Now that we have better tests, make this the default.
export VERBOSE = yes
-old_NEWS_hash = 103fb665dacfff3e8c0511af5ea07d4c
+old_NEWS_hash = 5b566d71ffd6be8de33ba990a2fd65f9
sc_prohibit_echo_minus_en:
@prohibit='\<echo -[en]' \
11 years, 7 months
[iwhd] version 1.6
by Jim Meyering
commit fefec1a1e9db545b459381bf0888cfc962dd8043
Author: Jim Meyering <meyering(a)redhat.com>
Date: Wed Aug 22 07:14:38 2012 +0200
version 1.6
* NEWS: Record release date.
NEWS | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index 9c62dc4..5b50a99 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
iwhd NEWS -*- outline -*-
-* Noteworthy changes in release ?.? (????-??-??) [?]
+* Noteworthy changes in release 1.6 (2012-08-22) [stable]
** Infrastructure
11 years, 7 months
[iwhd] maint: add a few entries in NEWS
by Jim Meyering
commit 2ea238e281ca6301d84db55e59e909255a23e5cd
Author: Jim Meyering <meyering(a)redhat.com>
Date: Wed Aug 22 07:14:19 2012 +0200
maint: add a few entries in NEWS
* NEWS (Infrastructure): Add entries, to placate last-minute
release-time sanity checks.
NEWS | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index d68cf0c..9c62dc4 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,14 @@ iwhd NEWS -*- outline -*-
* Noteworthy changes in release ?.? (????-??-??) [?]
+** Infrastructure
+
+ Tests work around a difference in how the latest version of curl works.
+
+ Build-related fixes and portability improvements via gnulib.
+
+ New and updated translations.
+
* Noteworthy changes in release 1.5 (2012-03-10) [stable]
11 years, 7 months
[iwhd] build: update gnulib submodule to latest
by Jim Meyering
commit 7a36345f52d97f5390324b2d139fecda94d07f45
Author: Jim Meyering <meyering(a)redhat.com>
Date: Wed Aug 22 06:59:26 2012 +0200
build: update gnulib submodule to latest
gnulib | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gnulib b/gnulib
index 39cedf6..eb872c4 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 39cedf6f427350ac47118d231c05a7b73b609f89
+Subproject commit eb872c43a7bfea71a5a3bb95b6817cc3d7c0966f
11 years, 7 months
[iwhd] dc-rhev-image: don't ignore setregid or setreuid failure
by Jim Meyering
commit c1508710440344b911285675a143c405045f9014
Author: Jim Meyering <meyering(a)redhat.com>
Date: Tue Aug 21 14:27:41 2012 +0200
dc-rhev-image: don't ignore setregid or setreuid failure
* dc-rhev-image.c (copyimage): Don't ignore setregid or setreuid
failure.
dc-rhev-image.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/dc-rhev-image.c b/dc-rhev-image.c
index ee2b5d3..66b8461 100644
--- a/dc-rhev-image.c
+++ b/dc-rhev-image.c
@@ -1908,8 +1908,11 @@ static void copyimage(const struct config *cfg, const struct id_pack *idp,
if (geteuid() == 0) {
/* printf("We're root, changing user and group to 36"); */
- setregid(-1, NFSGID);
- setreuid(-1, NFSUID);
+ if (setregid(-1, NFSGID) || setreuid(-1, NFSUID)) {
+ fprintf(stderr, "ERROR Failed to set-IDs to NFS: %s\n",
+ strerror (errno));
+ exit(EXIT_FAILURE);
+ }
} else {
if (geteuid() != NFSUID || getegid() != NFSGID) {
fprintf(stderr,
11 years, 7 months
[iwhd] build: update gnulib, bootstrap and t/init.sh
by Jim Meyering
commit 458f824e56aed53382829e8bc540d1fa81fec5f8
Author: Jim Meyering <meyering(a)redhat.com>
Date: Mon Aug 6 19:00:13 2012 +0200
build: update gnulib, bootstrap and t/init.sh
bootstrap | 267 ++++++++++++++++++++++++++++++----------------
gnulib | 2 +-
gnulib-tests/.gitignore | 2 +
lib/.gitignore | 1 +
t/init.sh | 13 ++-
5 files changed, 188 insertions(+), 97 deletions(-)
---
diff --git a/bootstrap b/bootstrap
index 31eb651..e3e270b 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
#! /bin/sh
# Print a version string.
-scriptversion=2012-02-11.09; # UTC
+scriptversion=2012-07-19.14; # UTC
# Bootstrap this package from checked-out sources.
@@ -36,6 +36,10 @@ nl='
LC_ALL=C
export LC_ALL
+# Ensure that CDPATH is not set. Otherwise, the output from cd
+# would cause trouble in at least one use below.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
local_gl_dir=gl
me=$0
@@ -73,6 +77,33 @@ Running without arguments will suffice in most cases.
EOF
}
+# warnf_ FORMAT-STRING ARG1...
+warnf_ ()
+{
+ warnf_format_=$1
+ shift
+ nl='
+'
+ case $* in
+ *$nl*) me_=$(printf "$me"|tr "$nl|" '??')
+ printf "$warnf_format_" "$@" | sed "s|^|$me_: |" ;;
+ *) printf "$me: $warnf_format_" "$@" ;;
+ esac >&2
+}
+
+# warn_ WORD1...
+warn_ ()
+{
+ # If IFS does not start with ' ', set it and emit the warning in a subshell.
+ case $IFS in
+ ' '*) warnf_ '%s\n' "$*";;
+ *) (IFS=' '; warn_ "$@");;
+ esac
+}
+
+# die WORD1...
+die() { warn_ "$@"; exit 1; }
+
# Configuration.
# Name of the Makefile.am
@@ -126,7 +157,8 @@ extract_package_name='
p
}
'
-package=`sed -n "$extract_package_name" configure.ac` || exit
+package=$(sed -n "$extract_package_name" configure.ac) \
+ || die 'cannot find package name in configure.ac'
gnulib_name=lib$package
build_aux=build-aux
@@ -182,6 +214,8 @@ use_git=true
# otherwise find the first of the NAMES that can be run (i.e.,
# supports --version). If found, set ENVVAR to the program name,
# die otherwise.
+#
+# FIXME: code duplication, see also gnu-web-doc-update.
find_tool ()
{
find_tool_envvar=$1
@@ -199,19 +233,15 @@ find_tool ()
else
find_tool_error_prefix="\$$find_tool_envvar: "
fi
- if test x"$find_tool_res" = x; then
- echo >&2 "$me: one of these is required: $find_tool_names"
- exit 1
- fi
- ($find_tool_res --version </dev/null) >/dev/null 2>&1 || {
- echo >&2 "$me: ${find_tool_error_prefix}cannot run $find_tool_res --version"
- exit 1
- }
+ test x"$find_tool_res" != x \
+ || die "one of these is required: $find_tool_names"
+ ($find_tool_res --version </dev/null) >/dev/null 2>&1 \
+ || die "${find_tool_error_prefix}cannot run $find_tool_res --version"
eval "$find_tool_envvar=\$find_tool_res"
eval "export $find_tool_envvar"
}
-# Find sha1sum, named gsha1sum on MacPorts, and shasum on MacOS 10.6.
+# Find sha1sum, named gsha1sum on MacPorts, and shasum on Mac OS X 10.6.
find_tool SHA1SUM sha1sum gsha1sum shasum
# Override the default configuration, if necessary.
@@ -226,7 +256,6 @@ esac
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
@@ -252,7 +281,7 @@ do
usage
exit;;
--gnulib-srcdir=*)
- GNULIB_SRCDIR=`expr "X$option" : 'X--gnulib-srcdir=\(.*\)'`;;
+ GNULIB_SRCDIR=${option#--gnulib-srcdir=};;
--skip-po)
SKIP_PO=t;;
--force)
@@ -266,21 +295,15 @@ do
--no-git)
use_git=false;;
*)
- echo >&2 "$0: $option: unknown option"
- exit 1;;
+ die "$option: unknown option";;
esac
done
-if $use_git || test -d "$GNULIB_SRCDIR"; then
- :
-else
- echo "$0: Error: --no-git requires --gnulib-srcdir" >&2
- exit 1
-fi
+$use_git || test -d "$GNULIB_SRCDIR" \
+ || die "Error: --no-git requires --gnulib-srcdir"
if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
- echo "$0: Bootstrapping from a non-checked-out distribution is risky." >&2
- exit 1
+ die "Bootstrapping from a non-checked-out distribution is risky."
fi
# Ensure that lines starting with ! sort last, per gitignore conventions
@@ -303,10 +326,10 @@ insert_sorted_if_absent() {
file=$1
str=$2
test -f $file || touch $file
- echo "$str" | sort_patterns - $file | cmp - $file > /dev/null \
+ echo "$str" | sort_patterns - $file | cmp -s - $file > /dev/null \
|| { echo "$str" | sort_patterns - $file > $file.bak \
&& mv $file.bak $file; } \
- || exit 1
+ || die "insert_sorted_if_absent $file $str: failed"
}
# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
@@ -319,7 +342,7 @@ insert_vc_ignore() {
# A .gitignore entry that does not start with '/' applies
# recursively to subdirectories, so prepend '/' to every
# .gitignore entry.
- pattern=`echo "$pattern" | sed s,^,/,`;;
+ pattern=$(echo "$pattern" | sed s,^,/,);;
esac
insert_sorted_if_absent "$vc_ignore_file" "$pattern"
}
@@ -330,11 +353,8 @@ grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
>/dev/null && found_aux_dir=yes
grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \
>/dev/null && found_aux_dir=yes
-if test $found_aux_dir = no; then
- echo "$0: expected line not found in configure.ac. Add the following:" >&2
- echo " AC_CONFIG_AUX_DIR([$build_aux])" >&2
- exit 1
-fi
+test $found_aux_dir = yes \
+ || die "configure.ac lacks 'AC_CONFIG_AUX_DIR([$build_aux])'; add it"
# If $build_aux doesn't exist, create it now, otherwise some bits
# below will malfunction. If creating it, also mark it as ignored.
@@ -423,31 +443,48 @@ check_versions() {
$use_git || continue
fi
# Honor $APP variables ($TAR, $AUTOCONF, etc.)
- appvar=`echo $app | LC_ALL=C tr '[a-z]-' '[A-Z]_'`
+ appvar=$(echo $app | LC_ALL=C tr '[a-z]-' '[A-Z]_')
test "$appvar" = TAR && appvar=AMTAR
case $appvar in
GZIP) ;; # Do not use $GZIP: it contains gzip options.
*) eval "app=\${$appvar-$app}" ;;
esac
+
+ # Handle the still-experimental Automake-NG programs specially.
+ # They remain named as the mainstream Automake programs ("automake",
+ # and "aclocal") to avoid gratuitous incompatibilities with
+ # pre-existing usages (by, say, autoreconf, or custom autogen.sh
+ # scripts), but correctly identify themselves (as being part of
+ # "GNU automake-ng") when asked their version.
+ case $app in
+ automake-ng|aclocal-ng)
+ app=${app%-ng}
+ ($app --version | grep '(GNU automake-ng)') >/dev/null 2>&1 || {
+ warn_ "Error: '$app' not found or not from Automake-NG"
+ ret=1
+ continue
+ } ;;
+ 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
+ warn_ "Error: '$app' not found"
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
+ warn_ "Error: '$app' not found"
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
+ warnf_ '%s\n' \
+ "Error: '$app' version == $inst_ver is too old" \
+ " '$app' version >= $req_ver is required"
ret=1
fi
fi
@@ -492,10 +529,8 @@ 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
+if test -d "$local_gl_dir" \
+ && ! find "$local_gl_dir" -name '*.diff' -exec false {} +; then
case $buildreq in
*patch*) ;;
*) buildreq="patch -
@@ -506,11 +541,10 @@ fi
if ! printf "$buildreq" | check_versions; then
echo >&2
if test -f README-prereq; then
- echo "$0: See README-prereq for how to get the prerequisite programs" >&2
+ die "See README-prereq for how to get the prerequisite programs"
else
- echo "$0: Please install the prerequisite programs" >&2
+ die "Please install the prerequisite programs"
fi
- exit 1
fi
echo "$0: Bootstrapping from checked-out $package sources..."
@@ -539,7 +573,7 @@ git_modules_config () {
test -f .gitmodules && git config --file .gitmodules "$@"
}
-gnulib_path=`git_modules_config submodule.gnulib.path`
+gnulib_path=$(git_modules_config submodule.gnulib.path)
test -z "$gnulib_path" && gnulib_path=gnulib
# Get gnulib files.
@@ -612,10 +646,10 @@ download_po_files() {
subdir=$1
domain=$2
echo "$me: getting translations into $subdir for $domain..."
- cmd=`printf "$po_download_command_format" "$domain" "$subdir"`
+ cmd=$(printf "$po_download_command_format" "$domain" "$subdir")
eval "$cmd" && return
# Fallback to HTTP.
- cmd=`printf "$po_download_command_format2" "$subdir" "$domain"`
+ cmd=$(printf "$po_download_command_format2" "$subdir" "$domain")
eval "$cmd"
}
@@ -638,7 +672,7 @@ update_po_files() {
&& ls "$ref_po_dir"/*.po 2>/dev/null |
sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return
- langs=`cd $ref_po_dir && echo *.po|sed 's/\.po//g'`
+ langs=$(cd $ref_po_dir && echo *.po | sed 's/\.po//g')
test "$langs" = '*' && langs=x
for po in $langs; do
case $po in x) continue;; esac
@@ -675,18 +709,18 @@ symlink_to_dir()
# If the destination directory doesn't exist, create it.
# This is required at least for "lib/uniwidth/cjk.h".
- dst_dir=`dirname "$dst"`
+ dst_dir=$(dirname "$dst")
if ! test -d "$dst_dir"; then
mkdir -p "$dst_dir"
# If we've just created a directory like lib/uniwidth,
# tell version control system(s) it's ignorable.
# FIXME: for now, this does only one level
- parent=`dirname "$dst_dir"`
+ parent=$(dirname "$dst_dir")
for dot_ig in x $vc_ignore; do
test $dot_ig = x && continue
ig=$parent/$dot_ig
- insert_vc_ignore $ig `echo "$dst_dir"|sed 's,.*/,,'`
+ insert_vc_ignore $ig "${dst_dir##*/}"
done
fi
@@ -710,10 +744,10 @@ symlink_to_dir()
# 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 &&
+ 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" &&
- both_ls=`ls -dt "$src" "$dst"` &&
+ both_ls=$(ls -dt "$src" "$dst") &&
test "X$both_ls" = "X$dst$nl$src" || {
dot_dots=
case $src in
@@ -721,11 +755,10 @@ symlink_to_dir()
*)
case /$dst/ in
*//* | */../* | */./* | /*/*/*/*/*/)
- echo >&2 "$me: invalid symlink calculation: $src -> $dst"
- exit 1;;
- /*/*/*/*/) dot_dots=../../../;;
- /*/*/*/) dot_dots=../../;;
- /*/*/) dot_dots=../;;
+ die "invalid symlink calculation: $src -> $dst";;
+ /*/*/*/*/) dot_dots=../../../;;
+ /*/*/*/) dot_dots=../../;;
+ /*/*/) dot_dots=../;;
esac;;
esac
@@ -736,6 +769,22 @@ symlink_to_dir()
}
}
+version_controlled_file() {
+ parent=$1
+ file=$2
+ if test -d .git; then
+ git rm -n "$file" > /dev/null 2>&1
+ elif test -d .svn; then
+ svn log -r HEAD "$file" > /dev/null 2>&1
+ elif test -d CVS; then
+ grep -F "/${file##*/}/" "$parent/CVS/Entries" 2>/dev/null |
+ grep '^/[^/]*/[0-9]' > /dev/null
+ else
+ warn_ "no version control for $file?"
+ false
+ fi
+}
+
# 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.
@@ -748,37 +797,54 @@ with_gettext=yes
grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
with_gettext=no
-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
+if test $with_gettext = yes || test $use_libtool = 1; then
-# 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 test $use_libtool = 1; then
- echo "running: $LIBTOOLIZE --copy --install"
- $LIBTOOLIZE --copy --install
-fi
+ tempbase=.bootstrap$$
+ trap "rm -f $tempbase.0 $tempbase.1" 1 2 13 15
-version_controlled_file() {
- dir=$1
- file=$2
- found=no
- if test -d CVS; then
- grep -F "/$file/" $dir/CVS/Entries 2>/dev/null |
- grep '^/[^/]*/[0-9]' > /dev/null && found=yes
- elif test -d .git; then
- git rm -n "$dir/$file" > /dev/null 2>&1 && found=yes
- elif test -d .svn; then
- svn log -r HEAD "$dir/$file" > /dev/null 2>&1 && found=yes
- else
- echo "$me: no version control for $dir/$file?" >&2
+ > $tempbase.0 > $tempbase.1 &&
+ find . ! -type d -print | sort > $tempbase.0 || exit
+
+ 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
- test $found = yes
-}
+
+ # 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.
+ # libtoolize 1.9b added the --install option; but we support back
+ # to libtoolize 1.5.22, where the install action was default.
+ if test $use_libtool = 1; then
+ install=
+ case $($LIBTOOLIZE --help) in
+ *--install*) install=--install ;;
+ esac
+ echo "running: $LIBTOOLIZE $install --copy"
+ $LIBTOOLIZE $install --copy
+ fi
+
+ find . ! -type d -print | sort >$tempbase.1
+ old_IFS=$IFS
+ IFS=$nl
+ for file in $(comm -13 $tempbase.0 $tempbase.1); do
+ IFS=$old_IFS
+ parent=${file%/*}
+ version_controlled_file "$parent" "$file" || {
+ for dot_ig in x $vc_ignore; do
+ test $dot_ig = x && continue
+ ig=$parent/$dot_ig
+ insert_vc_ignore "$ig" "${file##*/}"
+ done
+ }
+ done
+ IFS=$old_IFS
+
+ rm -f $tempbase.0 $tempbase.1
+ trap - 1 2 13 15
+fi
# Import from gnulib.
@@ -804,11 +870,12 @@ echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
$gnulib_tool $gnulib_tool_options --import $gnulib_modules &&
for file in $gnulib_files; do
- symlink_to_dir "$GNULIB_SRCDIR" $file || exit
+ symlink_to_dir "$GNULIB_SRCDIR" $file \
+ || die "failed to symlink $file"
done
bootstrap_post_import_hook \
- || { echo >&2 "$me: bootstrap_post_import_hook failed"; exit 1; }
+ || die "bootstrap_post_import_hook failed"
# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
# gnulib-populated directories. Such .m4 files would cause aclocal to fail.
@@ -836,16 +903,17 @@ 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
+ || die "autoreconf failed"
# Get some extra files from gnulib, overriding existing files.
for file in $gnulib_extra_files; do
case $file in
*/INSTALL) dst=INSTALL;;
- build-aux/*) dst=$build_aux/`expr "$file" : 'build-aux/\(.*\)'`;;
+ build-aux/*) dst=$build_aux/${file#build-aux/};;
*) dst=$file;;
esac
- symlink_to_dir "$GNULIB_SRCDIR" $file $dst || exit
+ symlink_to_dir "$GNULIB_SRCDIR" $file $dst \
+ || die "failed to symlink $file"
done
if test $with_gettext = yes; then
@@ -861,7 +929,19 @@ if test $with_gettext = yes; then
a\
'"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
}
- ' po/Makevars.template >po/Makevars || exit 1
+ ' po/Makevars.template >po/Makevars \
+ || die 'cannot generate po/Makevars'
+
+ # If the 'gettext' module is in use, grab the latest Makefile.in.in.
+ # If only the 'gettext-h' module is in use, assume autopoint already
+ # put the correct version of this file into place.
+ case $gnulib_modules in
+ *gettext-h*) ;;
+ *gettext*)
+ cp $GNULIB_SRCDIR/build-aux/po/Makefile.in.in po/Makefile.in.in \
+ || die "cannot create po/Makefile.in.in"
+ ;;
+ esac
if test -d runtime-po; then
# Similarly for runtime-po/Makevars, but not quite the same.
@@ -875,7 +955,8 @@ if test $with_gettext = yes; then
a\
'"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+}
}
- ' po/Makevars.template >runtime-po/Makevars || exit 1
+ ' po/Makevars.template >runtime-po/Makevars \
+ || die 'cannot generate runtime-po/Makevars'
# Copy identical files from po to runtime-po.
(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
diff --git a/gnulib b/gnulib
index 4dda933..39cedf6 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 4dda933b73d7768c4824f13c46fef6fd0e9dfb73
+Subproject commit 39cedf6f427350ac47118d231c05a7b73b609f89
diff --git a/gnulib-tests/.gitignore b/gnulib-tests/.gitignore
index eef2365..0555a1b 100644
--- a/gnulib-tests/.gitignore
+++ b/gnulib-tests/.gitignore
@@ -390,3 +390,5 @@ zerosize-ptr.h
/test-init.sh
/test-strtoul.c
/test-strtoull.c
+/root-uid.h
+/test-sys_types.c
diff --git a/lib/.gitignore b/lib/.gitignore
index cc220b4..800f4c5 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -246,3 +246,4 @@
/xvasprintf.c
/xvasprintf.h
/c-strcaseeq.h
+/sys_types.in.h
diff --git a/t/init.sh b/t/init.sh
index ae86714..5f6e638 100644
--- a/t/init.sh
+++ b/t/init.sh
@@ -207,6 +207,14 @@ else
fi
fi
+# If this is bash, turn off all aliases.
+test -n "$BASH_VERSION" && unalias -a
+
+# Note that when supporting $EXEEXT (transparently mapping from PROG_NAME to
+# PROG_NAME.exe), we want to support hyphen-containing names like test-acos.
+# That is part of the shell-selection test above. Why use aliases rather
+# than functions? Because support for hyphen-containing aliases is more
+# widespread than that for hyphen-containing function names.
test -n "$EXEEXT" && shopt -s expand_aliases
# Enable glibc's malloc-perturbing option.
@@ -403,8 +411,7 @@ path_prepend_ ()
case $path_dir_ in
'') fail_ "invalid path dir: '$1'";;
/*) abs_path_dir_=$path_dir_;;
- *) abs_path_dir_=`cd "$initial_cwd_/$path_dir_" && echo "$PWD"` \
- || fail_ "invalid path dir: $path_dir_";;
+ *) abs_path_dir_=$initial_cwd_/$path_dir_;;
esac
case $abs_path_dir_ in
*:*) fail_ "invalid path dir: '$abs_path_dir_'";;
@@ -440,7 +447,7 @@ setup_ ()
pfx_=`testdir_prefix_`
test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
|| fail_ "failed to create temporary directory in $initial_cwd_"
- cd "$test_dir_"
+ cd "$test_dir_" || fail_ "failed to cd to temporary directory"
# As autoconf-generated configure scripts do, ensure that IFS
# is defined initially, so that saving and restoring $IFS works.
11 years, 7 months
[iwhd] maint: avoid new syntax-check failure
by Jim Meyering
commit 6dc3083fffc5682b02cc0a50d71f9a67eece3bb0
Author: Jim Meyering <meyering(a)redhat.com>
Date: Mon Aug 6 18:59:59 2012 +0200
maint: avoid new syntax-check failure
* t/put-attr-on-nonexistent-object: Reverse compare arguments.
t/put-attr-on-nonexistent-object | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/t/put-attr-on-nonexistent-object b/t/put-attr-on-nonexistent-object
index 6bb5367..c692e8c 100755
--- a/t/put-attr-on-nonexistent-object
+++ b/t/put-attr-on-nonexistent-object
@@ -49,7 +49,7 @@ apply_attribute_to_nonexistent_object ()
# Ensure that the object does not appear in a listing:
printf '[\n]\n200' > exp || fail=1
curl_w -H 'Accept: */json' $b > out || fail=1
- compare out exp || fail=1
+ compare exp out || fail=1
}
apply_attribute_to_nonexistent_object
11 years, 7 months
[iwhd] maint: avoid use of strncpy; use stzncpy instead
by Jim Meyering
commit ee49dc81c75806fa11ccec409a3ff34f6963b18b
Author: Jim Meyering <meyering(a)redhat.com>
Date: Mon Aug 6 18:59:50 2012 +0200
maint: avoid use of strncpy; use stzncpy instead
* rest.c (stzncpy): Define.
(proxy_bucket_post): Use stzncpy in place of deprecated strncpy.
rest.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/rest.c b/rest.c
index 832c486..98e4d92 100644
--- a/rest.c
+++ b/rest.c
@@ -113,6 +113,21 @@ typedef struct {
MHD_AccessHandlerCallback handler;
} rule;
+/* Like stpncpy, but do ensure that the result is NUL-terminated,
+ and do not NUL-pad out to LEN. I.e., when strnlen (src, len) == len,
+ this function writes a NUL byte into dest[len]. Thus, the length
+ of the destination buffer must be at least LEN + 1.
+ The DEST and SRC buffers must not overlap. */
+static inline char *
+stzncpy (char *restrict dest, char const *restrict src, size_t len)
+{
+ char const *src_end = src + len;
+ while (src < src_end && *src)
+ *dest++ = *src++;
+ *dest = 0;
+ return dest;
+}
+
static void simple_closer (void *ctx);
static unsigned short my_port = MY_PORT;
@@ -1423,7 +1438,7 @@ proxy_bucket_post (void *cctx, struct MHD_Connection *conn, const char *url,
int rc = MHD_HTTP_BAD_REQUEST;
key = kv_hash_lookup(ms->dict,"_key");
if (key) {
- strncpy(ms->key,key,MAX_FIELD_LEN-1);
+ stzncpy(ms->key,key,MAX_FIELD_LEN-1);
kv_hash_delete(ms->dict,"_key");
if (!kv_find_val(ms->dict,post_find,NULL)) {
hash_do_for_each (ms->dict,post_foreach,ms);
11 years, 7 months
[iwhd] tests: auto: fix false-positive rawhide failure due to curl difference
by Jim Meyering
commit df523f2befaf541f7a181a9b38151289b0a4176e
Author: Jim Meyering <meyering(a)redhat.com>
Date: Sat Aug 4 14:36:30 2012 +0200
tests: auto: fix false-positive rawhide failure due to curl difference
We were relying on the format of curl diagnostics.
For the delete-nonexistent test, curl-7.24 prints this:
curl: (22) The requested URL returned error: 404
but curl-7.27 appends the "Not Found":
curl: (22) The requested URL returned error: 404 Not Found
* t/auto: Don't rely on unspecified details of curl output: use curl's
--write-out option to explicitly print the HTTP return code to stdout,
and test that rather than the unspecified diagnostic.
Also, when waiting for mongo, don't rely on the "wait_for" function
evaluating our command, i.e., use double quotes, not single.
This makes our use of $m_port more future-proof.
* t/basic: Fix 10 more instances of the curl problem. The first two
by converting to use compare, leaving the remaining ones with grep,
since that is the more concise change.
t/auto | 9 ++++++---
t/basic | 43 ++++++++++++++++++++++---------------------
2 files changed, 28 insertions(+), 24 deletions(-)
---
diff --git a/t/auto b/t/auto
index 5f7092d..334810e 100755
--- a/t/auto
+++ b/t/auto
@@ -24,7 +24,7 @@ cleanup_() { kill $iwhd_pid; }
# Wait longer than usual (i.e., don't use wait_for_mongo), since this
# mongo daemon was started via iwhd itself, and not with $mongo_opt
-wait_for .1 300 'mongo localhost:$m_port < /dev/null' \
+wait_for .1 300 "mongo localhost:$m_port < /dev/null" \
|| framework_failure_ mongod failed to start
# Wait for up to 20 seconds for iwhd to begin listening on $port.
wait_for .1 200 "curl -s http://localhost:$port" \
@@ -51,8 +51,11 @@ test "$(cat f1copy)" = foo || fail=1
curl -X DELETE http://localhost:$port/b1/f1 || fail=1
# Ensure that it's gone from the file system.
test -f _fs/b1/f1 && fail=1
+
+curl_w() { curl --write-out '%{http_code}\n' "$@"; }
# Ensure that it's gone in the API as well.
-curl -f http://localhost:$port/b1/f1 > /dev/null 2> del_object.err
-grep ' 404$' del_object.err || fail=1
+curl_w -f http://localhost:$port/b1/f1 > del_object.err
+echo 404 > exp || fail=1
+compare exp del_object.err || fail=1
Exit $fail
diff --git a/t/basic b/t/basic
index 6e8c083..8952893 100755
--- a/t/basic
+++ b/t/basic
@@ -22,6 +22,7 @@ mongod --help > /dev/null || fail_ "the mongod program is not installed"
mongod $mongo_opt --port $m_port --pidfilepath mongod/pid --dbpath mongod &
mongo_pid=$!
cleanup_() { kill -9 $mongo_pid; }
+curl_w() { curl --write-out '%{http_code}\n' "$@"; }
# Wait for mongod to begin listening.
wait_for_mongo $m_port \
@@ -75,12 +76,12 @@ curl -X PUT $bucket || fail=1
test -d FS/b1 || fail=1
# Try to create a duplicate bucket.
-curl -f -X PUT $bucket 2> dup_bucket.err
-grep ' 500$' dup_bucket.err || fail=1
+curl_w -f -X PUT $bucket > dup_bucket.err; echo 500 > exp || fail=1
+compare exp dup_bucket.err || fail=1
# PUT to root; should fail
-curl -f -X PUT http://localhost:$port 2> root_put.err
-grep ' 404$' root_put.err || fail=1
+curl_w -f -X PUT http://localhost:$port > root_put.err; echo 404 > exp || fail=1
+compare exp root_put.err || fail=1
# Create a file in that bucket.
echo foo | curl -T - $bucket/obj_test || fail=1
@@ -92,8 +93,8 @@ curl $bucket/obj_test > f1copy
test "$(cat f1copy)" = foo || fail=1
# Test that non-existing bucket gives 404 and not 500 or even 200 as before.
-curl -f http://localhost:$port/no_bucket 2> no_bucket.err
-grep ' 404$' no_bucket.err || fail=1
+curl_w -f http://localhost:$port/no_bucket > no_bucket.err
+grep '^404$' no_bucket.err || fail=1
# Get root; default, then Accept: XML & JSON:
curl http://localhost:$port > root || fail=1
@@ -110,17 +111,17 @@ curl -X DELETE $bucket/obj_test || fail=1
# Ensure that it's gone from the file system.
test -f FS/b1/obj_test && fail=1
# Ensure that it's gone in the API as well.
-curl -f $bucket/obj_test > /dev/null 2> del_object.err
-grep ' 404$' del_object.err || fail=1
+curl_w -f $bucket/obj_test > /dev/null > del_object.err
+grep '^404$' del_object.err || fail=1
# Try to delete a nonexistent object.
-curl -f -X DELETE $bucket/no-such-obj 2> del_nosuch.err
-grep ' 404$' del_nosuch.err || fail=1
+curl_w -f -X DELETE $bucket/no-such-obj > del_nosuch.err
+grep '^404$' del_nosuch.err || fail=1
# Make sure the X-redhat-role header causes failure on a master iwhd.
-echo hello | curl -f -T - -H "X-redhat-role: master" $bucket/role_test \
- 2> role.err
-grep ' 403$' role.err || fail=1
+echo hello | curl_w -f -T - -H "X-redhat-role: master" $bucket/role_test \
+ > role.err
+grep '^403$' role.err || fail=1
# ################## Providers
@@ -236,13 +237,13 @@ compare exp-attr-xml out-attr-deprecated || fail=1
# FIXME: keep this list in sync with the one in rest.c:
# grep '^static.*reserved_name' rest.c
for obj_name in _default _new _policy _query; do
- echo reserved-obj-name | curl -f -T - $bucket/$obj_name 2> bad_oname.err
+ echo reserved-obj-name | curl_w -f -T - $bucket/$obj_name > bad_oname.err
# _query evokes 404. all others evoke 403
case $obj_name in
_query) exp=404;;
*) exp=403;;
esac
- grep " $exp\$" bad_oname.err || fail=1
+ grep "^$exp\$" bad_oname.err || fail=1
done
# Keep this list of reserved words in sync with the one in rest.c:
@@ -264,8 +265,8 @@ for attr in $attr_words; do
*) exp=400;;
esac
- printf whatever | curl -f -T - $bucket/rsvd_attr/$attr 2> bad_attr.err
- grep " $exp$" bad_attr.err \
+ printf whatever | curl_w -f -T - $bucket/rsvd_attr/$attr > bad_attr.err
+ grep "^$exp$" bad_attr.err \
|| fail_ "expected ...$exp; got this: $(cat bad_attr.err)"
done
@@ -274,14 +275,14 @@ done
# grep '^static.*reserved_bucket_name' rest.c
for b in _new _providers; do
invalid_bucket=http://localhost:$port/$b
- curl -f -X PUT $invalid_bucket 2> invalid_bucket.err
+ curl_w -f -X PUT $invalid_bucket > invalid_bucket.err
# FIXME: change the code so that these are the same
case $b in
_new) exp=400;; # MHD_HTTP_BAD_REQUEST
*) exp=404;;
esac
cat invalid_bucket.err
- grep " $exp\$" invalid_bucket.err || fail=1
+ grep "^$exp\$" invalid_bucket.err || fail=1
done
# Make sure PUTting a file truncates.
@@ -324,10 +325,10 @@ curl http://localhost:$port/_providers > p || fail=1
grep PROVIDER-2 p && { warn_ $ME_: provider deletion failed; fail=1; }
# Delete a non-existent provider.
-curl -f -X DELETE http://localhost:$port/_providers/no-such 2> p
+curl_w -f -X DELETE http://localhost:$port/_providers/no-such > p
# ensure it fails; expect exit-22 and http: 404
test $? = 22 || fail=1
-grep ' 404$' p || fail=1
+grep '^404$' p || fail=1
# Get the name of the current primary provider.
curl http://localhost:$port/_providers/_primary > p || fail=1
11 years, 7 months