Dmitry V. Levin [Wed, 11 Jan 2012 20:49:06 +0000 (00:49 +0400)]
getloadavg test: skip the test on GNU/Linux without /proc mounted
GNU libc implements getloadavg(3) on Linux by parsing /proc/loadavg
file. When /proc is not mounted, it always fails with ENOENT.
* tests/test-getloadavg.c (main): Treat ENOENT return code from
getloadavg(3) the same way as ENOSYS and ENOTSUP.
Bruno Haible [Tue, 10 Jan 2012 19:53:57 +0000 (20:53 +0100)]
doc: Mention --with-tests option.
* gnulib-tool (func_usage): Suggest --with-tests for --test etc.
* doc/gnulib.texi (Extra tests modules): Mention the need to pass
--with-tests.
Reported by Reuben Thomas.
Jim Meyering [Mon, 9 Jan 2012 09:12:18 +0000 (10:12 +0100)]
test-init.sh: avoid a subshell
* tests/test-init.sh: Remove protective subshell.
Suggested by Bernhard Voelker. While a subshell is normally
required to protect against older shells (Solaris, FreeBSD) that
warn about a missing program before performing redirection, the
shell-selection tests performed by init.sh probably exclude any
offending shell.
Paolo Bonzini [Sun, 18 Dec 2011 14:33:53 +0000 (15:33 +0100)]
quotearg: fall back to Unicode single quotes in UTF-8 and GB-18030 locales
Most programs do not have translation catalogs for English and much less
separate catalogs for British and American English. Drop the suggestion
to translators about these two, and provide it automatically for Unicode
locales. Like most programs, even those using American English, we use
single quotation marks. This conflicts with the American typographic
convention, but works better when you cite the entire error message
within double quotes. It also tries not to clash with established
practice and with what non-gnulib programs will usually do.
* lib/quotearg.c (gettext_quote): Hard-code U+2018 and U+2019 when using
an UTF-8 or GB-18030 locale. The list of other locales with quotes was
provided by Bruno Haible.
(quotearg_buffer_restyled): Adjust instructions to translators.
* lib/quotearg.h (locale_quoting_style): Do not put an example in the
text, since this would be wrong when using Unicode.
* modules/quotearg: Depend on c-strcaseeq.
Jim Meyering [Wed, 4 Jan 2012 19:19:37 +0000 (20:19 +0100)]
test-init.sh: accommodate Solaris 5.10's different diff -u output
* tests/test-init.sh: Also exempt @@ lines from the comparison
of diff output, since Solaris 5.10 and GNU diff formats differ.
Reported by Stefano Lattarini.
Paul Eggert [Thu, 5 Jan 2012 00:04:38 +0000 (16:04 -0800)]
test-posixtm: don't assume signed integer wraparound
* tests/test-posixtm.c (main): Don't assume wraparound semantics
after signed integer overflow. Inspired by (though it may not
fix) Bruno Haible's bug report in
<http://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00066.html>.
Rationale:
Microsoft renamed the "Win32 API" to "Windows API", as it is available
on both 32-bit and 64-bit Windows systems.
But in gnulib, we treat Cygwin like a Unix platform, therefore the main
line of distinction is between "native Windows" on one side and Unix/
POSIX systems on the other side. More details in
<https://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00027.html>.
Suggested by Paul Eggert.
Bruno Haible [Tue, 3 Jan 2012 12:52:36 +0000 (13:52 +0100)]
isatty: Support for MSVC 9.
* doc/posix-functions/isatty.texi: Mention the MSVC problem.
* lib/isatty.c: Include <errno.h>, msvc-inval.h.
(_isatty_nothrow): New function.
(isatty): Use it instead of _isatty.
(IsConsoleHandle): Add comment, from Paolo Bonzini.
* lib/poll.c (IsConsoleHandle): Likewise.
* lib/select.c (IsConsoleHandle): Likewise.
* m4/isatty.m4 (gl_FUNC_ISATTY): Fix comment. Reported by Eli Zaretskii.
(gl_PREREQ_ISATTY): New macro.
* modules/isatty (Depends-on): Add msvc-inval.
(configure.ac): Invoke gl_PREREQ_ISATTY.
Jim Meyering [Tue, 3 Jan 2012 10:35:43 +0000 (11:35 +0100)]
maint.mk: remove temporary transition aid from over 1.5 years ago
* top/maint.mk (_prohibit_regexp): Remove definition whose sole
purpose was to aid in the transition (avoiding silent malfunction)
from that old name to the new _sc_search_regexp. This shim was
added by commit 219c504b.
Jim Meyering [Tue, 3 Jan 2012 07:21:09 +0000 (08:21 +0100)]
init.sh: do not try to accommodate compare arguments starting with "-"
* tests/init.sh (compare_dev_null_): Do not try to accommodate
compare arguments that start with "-". Besides, we do not worry
about this when invoking diff or cmp; why start now with sed?
Using "--" to separate options from argument would trigger sed
failure in at least Solaris 7, HP-UX 11.00, IRIX 6.5, FreeBSD 6.4,
OpenBSD 4.9 and NetBSD 5.1. Reported by Bruno Haible.
Bruno Haible [Tue, 3 Jan 2012 02:56:16 +0000 (03:56 +0100)]
Enhance tests for module 'isatty'.
* modules/isatty-tests (Depends-on): Add pipe-posix.
* tests/test-isatty.c: Include <fcntl.h>.
(DEV_NULL): New macro.
(main): Test the resut of isatty() also on regular files, pipes, and
/dev/null.
Bruno Haible [Tue, 3 Jan 2012 02:54:08 +0000 (03:54 +0100)]
New module 'isatty'.
* lib/unistd.in.h (isatty): New declaration.
* lib/isatty.c: New file, based on an idea of
Bastien Roucariès <roucaries.bastien@gmail.com>.
* m4/isatty.m4: New file.
* m4/unistd_h.m4 (gl_UNISTD_H): Test whether isatty is declared.
(gl_UNISTD_H_DEFAULTS): Initialize GNULIB_ISATTY, REPLACE_ISATTY.
* modules/unistd (Makefile.am): Substitute GNULIB_ISATTY,
REPLACE_ISATTY.
* modules/isatty: New file.
* doc/posix-functions/isatty.texi: Mention the new module.
Suggested by Paolo Bonzini.
Jim Meyering [Fri, 30 Dec 2011 18:00:49 +0000 (19:00 +0100)]
gitlog-to-changelog: don't malfunction when name contains %-directive
* build-aux/gitlog-to-changelog (main): Don't let a %-directive
in a name string cause trouble. E.g., with a user name of "%s",
gitlog-to-changelog would fail with "Missing argument in sprintf at..."
* build-aux/gitlog-to-changelog (main): Map the string, at beginning
of line in a git commit log, "Copyright-paperwork-exempt: yes", to
the " (tiny change)" notation that is appended to the standard
ChangeLog "date name email" header line.
When using gnulib-tool's --with-tests option and any module that
depends on test-framework-sh, "make dist" would fail due to the
lack of init.sh *in lib/*. The EXTRA_DIST += init.sh is required
in the gltests directory, and not in the gllib/ directory.
One way to work around that is to move the EXTRA_DIST += init.sh
from the primary module to the -tests one:
* modules/test-framework-sh-tests (EXTRA_DIST): Add init.sh here, ...
* modules/test-framework-sh (Makefile.am): ...not here.
Reported by Tom G. Christensen in
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/29519
Pádraig Brady [Sat, 31 Dec 2011 11:03:58 +0000 (11:03 +0000)]
canonicalize: only stat() when required
* lib/canonicalize.c (canonicalize_filename_mode):
Avoid calling l?stat() when both CAN_MISSING,
and CAN_NOLINKS are set, as then we neither need
to resolve symlinks or test component existence.
Pádraig Brady [Thu, 29 Dec 2011 23:49:53 +0000 (23:49 +0000)]
canonicalize: add support for not resolving symlinks
This will initially be used by a new coreutils realpath command.
* lib/canonicalize.h: Add the CAN_NOLINKS flag to
indicate we don't want to follow symlinks. Also
provide CAN_MODE_MASK to aid setting these existing
mutually exclusive values.
* lib/canonicalize.c (canonicalize_filename_mode):
Extract the flags from can_mode parameter, which
are currently just used to select between stat()
and lstat(). Also ensure that mutually exclusive
values are flagged immediately as invalid.
* tests/test-canonicalize.c: Verify symlinks are
not followed, and that invalid flag combinations
are diagnosed.
Jim Meyering [Sun, 25 Dec 2011 15:14:36 +0000 (16:14 +0100)]
gitlog-to-changelog: do not clump multi-paragraph entries
Identical header lines (date,name,email+coauthors) are suppressed,
thus putting all entries with those same characteristics under
a single header. However, when a log entry consists of two or
more paragraphs, it may not be clear where it starts and ends.
This change makes it so that such an entry is always separated
from others by a header line, even when that header would
otherwise be suppressed.
* build-aux/gitlog-to-changelog: Implement the above.
Inspired by a related request from Stefano Lattarini in
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/29456
Jim Meyering [Fri, 23 Dec 2011 15:44:55 +0000 (16:44 +0100)]
test-framework-sh: distribute init.sh
* modules/test-framework-sh (EXTRA_DIST): Append init.sh.
Otherwise, "make -C gnulib-tests check" (at least in grep) would
fail due to the lack of init.sh.
Jim Meyering [Thu, 22 Dec 2011 11:42:32 +0000 (12:42 +0100)]
init.sh: avoid unwarranted test failure when using "set -x"
* tests/init.sh (compare): Ignore nonzero exit from compare_dev_null_.
Otherwise, in a test script that uses "set -x" (like many in vc-dwim)
a use like "compare exp out" would get evoke an unconditional failure.
Alfred M. Szmidt [Wed, 21 Dec 2011 09:47:03 +0000 (10:47 +0100)]
bootstrap: fix it to honor $ACLOCAL_FLAGS once again
The 2011-12-17 change, commit 767ccd40, replaced a manual invocation
of aclocal that used explicit $ACLOCAL_FLAGS with an invocation of
autoreconf that did not.
* build-aux/bootstrap: Use $ACLOCAL_FLAGS when invoking autoreconf.
Reported by Mats Erik Andersson <gnu@gisladisker.se>.
Jim Meyering [Sat, 17 Dec 2011 16:00:44 +0000 (17:00 +0100)]
bootstrap: remove some now-unneeded code
This script arose back when gnulib-tool was young.
Since then, it has seen improvements that render much of this
script unnecessary. In particular, it can now make symlinks
to the files it uses. Also, I no longer see as much value in
marking files as read-only via comments.
If you relied on the symlink-creation feature of the preceding
version of this script, you can get most of that functionality
by adding the --symlink option to the definition of
gnulib_tool_option_extras in your bootstrap.conf file.
* build-aux/bootstrap (AUTOPOINT, AUTORECONF): Factor out definitions.
Run autopoint and libtoolize *before* gnulib-tool.
After it, run an abbreviated autoreconf, rather than a loop around
all tools.
(slirp, bt_mark_as_generated): Remove functions.
Jim Meyering [Sat, 17 Dec 2011 15:28:55 +0000 (16:28 +0100)]
bootstrap: correct the recent buildreq change
The 2011-12-07 commit, 39f5f1e4, omitted some '*'s, and thus
had no effect.
* build-aux/bootstrap (buildreq): Bracket each search term with
"*...*", so that the shell "case" statement works as intended.
Add comments.
build: let bootstrap resort to wget for downloading .po files
* build-aux/bootstrap (download_po_files): Fallback to wget when
downloading the .po files via rsync failed. This is necessary to
bootstrap behind a strict firewall.
Paul Eggert [Thu, 15 Dec 2011 19:48:25 +0000 (11:48 -0800)]
stdint: don't assume C++11 when compiling with g++
Problem reported for glibc 2.14 and g++ by Alexander V. Lukyanov in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-12/msg00099.html>.
* m4/stdint.m4 (gl_STDINT_H): Don't go to extra work to make it
work also in C++ before C++11, as that improperly inhibits
generating a substitute stdint.h for that case.