Bruno Haible [Sat, 4 Sep 2010 16:39:03 +0000 (18:39 +0200)]
gnulib-tool: Change --import. New options --add/remove-import.
* gnulib-tool: New options --add-import, --remove-import.
(func_usage): Document them.
(have_associative): Define always.
(func_import): In import mode, don't merge the specified settings with
the cached settings. Implement remove-import mode.
* doc/gnulib-tool.texi (Modified imports): Mention the new options.
Explain when to use them versus --import.
(Simple update): Use --add-import instead of --import.
* NEWS: Mention the change.
Jim Meyering [Sat, 4 Sep 2010 16:16:04 +0000 (18:16 +0200)]
maint.mk: avoid obscure sc_copyright_check failure in coreutils
* top/maint.mk (v_etc_file): Prepend $(gnulib_dir)/, to avoid
false positives (whose names may be ill-chosen) when searching
non-VC'd files. Otherwise, a file named "a b/lib/version-etc.c"
would cause a false-positive.
Jim Meyering [Sat, 4 Sep 2010 15:43:39 +0000 (17:43 +0200)]
avoid coreutils "make distcheck" failure
Coreutils tests with an absolute build directory name that contains
a space. Not quoting this directory name caused a failure.
* tests/test-vc-list-files-git.sh: Quote PATH dir name.
* tests/test-vc-list-files-cvs.sh: Likewise.
Bruno Haible [Sat, 4 Sep 2010 11:58:02 +0000 (13:58 +0200)]
update-copyright test: Improve output when perl is missing or too old.
* tests/test-update-copyright.sh: Move test of Perl version down after
the test whether Perl exists. Provide an explanation relating Perl's
error message to Automake's SKIP: message.
Bruno Haible [Sat, 4 Sep 2010 09:16:43 +0000 (11:16 +0200)]
Set PATH_SEPARATOR the same way autoconf does.
* build-aux/relocatable.sh.in (func_find_curr_installdir): Determine
the value of PATH_SEPARATOR the same way autoconf-generated configure
scripts do.
* m4/lib-ld.m4 (AC_LIB_PROG_LD): Likewise.
* m4/progtest.m4 (AM_PATH_PROG_WITH_TEST): Likewise.
* gnulib-tool (func_gnulib_dir): Determine the value of PATH_SEPARATOR
the same way autoconf-generated configure scripts do.
* posix-modules: Likewise.
Eric Blake [Thu, 2 Sep 2010 19:49:41 +0000 (13:49 -0600)]
tests: init.sh improvements for re-exec'ing with zsh
Tom's IRIX setup had a broken bash, and proceeded to run zsh
outside of POSIX mode. But trying to trace that setup proved
difficult, since the re-exec lost tracing.
* tests/init.sh: Borrow autoconf POSIX-mode sanitization. Pass
-vx through shell re-exec.
Reported by Tom G. Christensen.
Bruno Haible [Thu, 2 Sep 2010 09:15:39 +0000 (11:15 +0200)]
wctype: Avoid compilation error on IRIX 6.5.30.
* lib/wctype.in.h (iswblank): Declare with a replacement if
REPLACE_ISWBLANK is set.
* m4/wctype_h.m4 (gl_WCTYPE_H): Check also whether iswblank is
declared. Set REPLACE_ISWBLANK.
* modules/wctype (Makefile.am): Substitute REPLACE_ISWBLANK.
* doc/posix-functions/iswblank.texi: Mention the IRIX 6.5.30 problem.
* doc/posix-headers/wctype.texi: Likewise.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.
Paul Eggert [Wed, 1 Sep 2010 20:45:53 +0000 (13:45 -0700)]
fcntl-h, etc.: prefer O_SEARCH to O_RDONLY when applicable
POSIX 2008 specifies a new 'open' flag O_SEARCH, which can be used
when one needs search access to a directory but not read access.
On systems where it is available, it works in some cases where
O_RDONLY does not, namely on directories that are searchable but
not readable, and which need only to be searchable. If O_SEARCH
is not available, fall back to the traditional method of using
O_RDONLY.
* lib/fcntl.in.h (O_SEARCH): #define to O_RDONLY if not defined.
* lib/chdir-long.c (cdb_advance_fd): Use O_SEARCH, not O_RDONLY,
when opening a directory that needs only to be searchable.
* lib/chdir-safer.c (chdir_no_follow): Likewise.
* lib/fts.c (diropen, fts_open, fd_ring_check): Likewise.
* lib/openat-proc.c (openat_proc_name): Likewise.
* lib/openat.c (openat_needs_fchdir): Likewise.
* lib/save-cwd.c (save_cwd): Likewise.
* lib/savewd.c (savewd_save, savewd_chdir): Likewise.
Eric Blake [Tue, 31 Aug 2010 08:10:32 +0000 (10:10 +0200)]
hash: factor, and guard against misbehaving hasher function
* lib/hash.c (safe_hasher): New function, to encapsulate the checking
of table->hasher's return value. Also protect against a hash value
so large that adding it to table->bucket results in a NULL pointer.
(hash_lookup, hash_get_next, hash_find_entry, transfer_entries):
Use it in place of open-coded check-and-abort.
read-file: Avoid memory reallocations with regular files.
* lib/read-file.c: Include <sys/stat.h>, <stdio.h>, <stdint.h>.
(fread_file): With regular files, use the remaining length as the
initial buffer size. Check against overflow.
* modules/read-file (Depends-on): Add ftello, malloc-posix, stdint,
sys_stat.
Eric Blake [Thu, 26 Aug 2010 22:43:13 +0000 (16:43 -0600)]
btowc: fix missing file
Detected by ./gnulib-tool --test btowc.
configure.ac:111: warning: gt_LOCALE_FR is m4_require'd but not m4_defun'd
glm4/btowc.m4:7: gl_FUNC_BTOWC is expanded from...
configure.ac:27: gl_INIT is expanded from...
configure.ac:111: the top level
Eric Blake [Thu, 26 Aug 2010 22:12:06 +0000 (16:12 -0600)]
include_next: silence autoconf 2.68 warning
Next warning spotted by Autoconf; this time it is spurious (when
checking for a working include_next, we could care less what other
defines have already been provided by AC_DEFINE). Which makes this
the first real-world use case outside of autoconf guts that can
reasonably use the new autoconf macro.
* m4/include_next.m4 (gl_INCLUDE_NEXT): Mark this use of
AC_COMPILE_IFELSE as special.
(AC_LANG_DEFINES_PROVIDED): Provide dummy implementation for
autoconf < 2.68.
Paul Eggert [Tue, 24 Aug 2010 05:34:00 +0000 (22:34 -0700)]
priv-set: fix comments
* lib/priv-set.c (priv_set_remove, priv_set_restore): Fix comments
to match code, as suggested by David Bartley in:
http://lists.gnu.org/archive/html/bug-tar/2010-08/msg00018.html
Eric Blake [Mon, 23 Aug 2010 21:04:42 +0000 (15:04 -0600)]
stdbool: avoid rejecting clang
* m4/stdbool.m4 (AC_HEADER_STDBOOL): Resync with autoconf.
* tests/test-stdbool.c: Enable more tests if using the system
<stdbool.h> instead of the gnulib replacement.
(main): Move xlc bug test to a runtime test for all compilers.
Reported by Anders Kaseorg.
Paolo Bonzini [Mon, 23 Aug 2010 07:35:43 +0000 (09:35 +0200)]
poll, select: handle ERROR_BROKEN_PIPE.
* lib/poll.c (win32_compute_revents): Return POLLHUP when
PeekNamedPipe fails with ERROR_BROKEN_PIPE.
* lib/select.c (win32_compute_revents): Do not mark a pipe
as writeable if PeekNamedPipe fails with ERROR_BROKEN_PIPE.
Eric Blake [Mon, 16 Aug 2010 23:34:45 +0000 (17:34 -0600)]
test-stddef: test for (some) offsetof bugs
See the mailing list for a more comprehensive patch that works
around the Solaris bug.
* tests/test-stddef.c: Enhance test to ensure correct type of
offsetof.
* doc/posix-headers/stddef.texi (stddef.h): Document a Solaris bug
that we are not fixing at this time.
Pádraig Brady [Thu, 10 Jun 2010 14:12:48 +0000 (15:12 +0100)]
copy-acl: ignore ENOTSUP on HP-UX
Fixes Coreutils bug 6053.
* lib/acl-internal.h (ACL_NOT_WELL_SUPPORTED): Move definition up,
so that it is available for HP-UX.
* lib/copy-acl.c (qcopy_acl): Use it.
Reported by Patrick M. Callahan.