summaryrefslogtreecommitdiff
path: root/gl
AgeCommit message (Collapse)Author
2013-09-10build: fix corrupted patch causing bootstrap failuresPádraig Brady
The patch was corrupted in commit v8.21-50-g7b65f8e * gl/modules/tempname.diff: Fix the offsets so that the patch applies cleanly. Note that this was only apparent with patch < 2.6. With patch >= 2.6, patch will not indicate an error applying the second hunk of the patch and silently ignore it. I double checked that all patches now apply cleanly by adjusting gnulib-tool to run patch with --fuzz=0 which might be advisable going forward, even on a per project basis. The silent ignoring of hunks by newer patch(1) has been reported. Fixes http://bugs.gnu.org/15255
2013-07-02maint: refactor SMACK interface to a separate modulePádraig Brady
Consolidate all smack routines and checks in a module. We replace and wrap the most commonly used smack routines, which allows removing ifdefs throughout the code. * gl/lib/smack.h: A new header containing the implementation of the wrapped and replacement routines. Note the is_smack_enabled() routine should be optimized out at compile time when compiled on a system without libsmack. * gl/modules/smack: Describe the new module and move the configure time code here from ... * m4/jm-macros.m4: ... here. * bootstrap.conf: Reference the new module. * src/id.c: Use the routines without ifdefs where possible. * src/ls.c: Likewise. * src/mkdir.c: Likewise. * src/mkfifo.c: Likewise. * src/mknod.c: Likewise.
2013-05-18maint: port --enable-gcc-warnings to clangPaul Eggert
* configure.ac: If clang, add -Wno-format-extra-args and -Wno-tautological-constant-out-of-range-compare. * gl/lib/rand-isaac.c (ind): * gl/lib/randread.c (readisaac): * src/ls.c (dev_ino_push, dev_ino_pop): * src/sort.c (buffer_linelim): * src/system.h (is_nul): * src/tail.c (tail_forever_inotify): Rewrite to avoid casts that clang dislikes. It's good to avoid casts anyway. * src/expr.c (integer_overflow): Declare only if it exists. (die): Remove; unused. * src/ls.c (dev_ino_push): New function, replacing ... (DEV_INO_PUSH): ... this removed macro. All uses changed. (decode_switches): Rewrite "str"+i to &str[i].
2013-05-11build: update gnulib submodule to latestPaul Eggert
2013-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright", but then also run this, perl -pi -e 's/2\d\d\d-//' tests/sample-test to make that one script use the single most recent year number.
2012-09-20build: move non-recursive-gnulib-prefix-hack to gnulib; updateJim Meyering
I've moved the non-recursive-gnulib-prefix-hack module to gnulib, with two small improvements, so remove it from here and update gnulib to the latest. * gl/build-aux/prefix-gnulib-mk: Remove file. * gl/m4/non-recursive-gnulib-prefix-hack.m4: Remove file. * gl/modules/non-recursive-gnulib-prefix-hack: Remove file. * gnulib: Update to latest.
2012-09-14build: don't prefix the RHS of "GPERF = ..." with "lib/"Jim Meyering
* gl/build-aux/prefix-gnulib-mk (prefix_assignment): Exempt the RHS of a "GPERF = ..." assignment from lib/ prefixing.
2012-09-12maint: mbsalign.h: fix typo from previous comment editBernhard Voelker
* gl/lib/mbsalign.h: Fix comment typo.
2012-09-11build: handle @ALLOCA@-vs-non-recursive make problemsJim Meyering
Here is a good reason to avoid alloca with non-recursive make. These: $ grep @ALLOCA lib/gnulib.mk lib_libcoreutils_a_LIBADD += lib/@ALLOCA@ lib_libcoreutils_a_DEPENDENCIES += lib/@ALLOCA@ would lead to this, when @ALLOCA@ expands to the empty string, which is essentially "always", now: $ grep ' lib/$' Makefile lib_libcoreutils_a_LIBADD = $(gl_LIBOBJS) lib/ lib_libcoreutils_a_DEPENDENCIES = $(gl_LIBOBJS) lib/ Tell the prefix-adding script not to add a prefix when the word it's prefixing is "@ALLOCA@". That is fine for most cases, but what about when the expansion of @ALLOCA@ is nonempty? * build-aux/prefix-gnulib-mk (prefix_word): Exclude @ALLOCA@. * gl/m4/non-recursive-gnulib-prefix-hack.m4: Prefix non-empty $ALLOCA with "lib/". FIXME: I'm not sure this is required, now that we... Use AC_CONFIG_LIBOBJ_DIR([lib]). Without using AC_CONFIG_LIBOBJ_DIR([lib]), automake (not autoconf) would complain of failure to find aclocal.c, due to the use of AC_LIBSOURCES(alloca.c).
2012-09-11build: new module to convert lib/ to non-recursive makeJim Meyering
* gl/modules/non-recursive-gnulib-prefix-hack: New module. * gl/m4/non-recursive-gnulib-prefix-hack.m4: (gl_NON_RECURSIVE_GNULIB_PREFIX_HACK): This is the snippet that this module inserts near the end of configure. * gl/build-aux/prefix-gnulib-mk: New script, from bison. Changes from the code in bison: (prefix_assignment): Split a long line. (prefix): Add trailing slashes to avoid a single false match. Prefix imaxtostr.c and the other *tostr.c file names manually. Also, use $prefix in place of hard-coded "lib/".
2012-09-11maint: add more control flags to mbsalignPádraig Brady
* gl/lib/mbsalign.h: Add MBA_UNIBYTE_ONLY (to allow faster processing). Also add MBA_NO_LEFT_PAD, MBA_NO_RIGHT_PAD to give greater control of padding, useful with the first or last fields on a line. * gl/lib/mbsalign.c (mbsalign): Implement the new flags. * gl/tests/test-mbsalign.c (main): Test combinations of the new flags.
2012-09-10maint: move the last coreutils-specific files from lib/ to gl/Jim Meyering
Convert the few remaining coreutils-specific files in lib/ to gnulib-style modules under gl/, removing their corresponding .m4 files, since the information recorded in those files is better stored in module-description file in gl/modules/. * bootstrap.conf (gnulib_modules): Add new modules: fd-reopen, buffer-lcm, xfts, strnumcmp. * gl/lib/buffer-lcm.c: Renamed from the file in lib/. * gl/lib/buffer-lcm.h: Likewise. * gl/lib/fd-reopen.c: Likewise. * gl/lib/fd-reopen.h: Likewise. * gl/lib/strintcmp.c: Likewise. * gl/lib/strnumcmp-in.h: Likewise. * gl/lib/strnumcmp.c: Likewise. * gl/lib/strnumcmp.h: Likewise. * gl/lib/xfts.c: Likewise. * gl/lib/xfts.h: Likewise. * gl/modules/buffer-lcm: New module-description file. * gl/modules/fd-reopen: Likewise. * gl/modules/strnumcmp: Likewise. * gl/modules/xfts: Likewise. * m4/fd-reopen.m4: Remove, no longer needed. * m4/strnumcmp.m4: Likewise. * m4/xfts.m4: Likewise. * m4/prereq.m4: Do not AC_REQUIRE the m4 functions from our just-removed m4/*.m4 files.
2012-09-10maint: move gl/m4/root-dev-ino.m4 contents into its module definitionJim Meyering
We can get the same effect using the modules file. * gl/m4/root-dev-ino.m4: Remove file. * gl/modules/root-dev-ino (Depends-on): Add lstat. (Files): Remove m4/root-dev-ino.m4. (Makefile.am) [lib_SOURCES]: Add root-dev-ino.c and root-dev-ino.h. (configure.ac): Remove reference to gl_ROOT_DEV_INO.
2012-07-27maint: refresh stale local gnulib patch filesJim Meyering
We carry local adjustments for a few gnulib modules via the patches in gl/. Nearly all of those patches had become stale due to evolution of the originals in gnulib. To refresh them, first make sure you have no local changes in gl/ or in the gnulib submodule, then run "make refresh-gnulib-patches".
2012-06-10build: update gnulib to latest; correct comment grammarJim Meyering
* tests/misc/help-version: Fix comment grammar: s/all these/all of these/ * gl/lib/tempname.c.diff: Likewise.
2012-02-12build: correct @@-,length values in last hunk of regcomp.c.diffJim Meyering
* gl/lib/regcomp.c.diff: Correct invalid hunk lengths (s/1/7/g) in the last hunk's @@-line.
2012-02-12build: update gnulib, bootstrap, gl/lib/regcomp.c.diffJim Meyering
* gnulib: Update submodule to latest. * bootstrap: Update from gnulib. * gl/lib/regcomp.c.diff: Adapt to gnulib changes.
2012-01-27maint: use single copyright year rangeJim Meyering
Run "make update-copyright".
2012-01-09maint: straggler *.[ch] files: convert more `...' to '...'Jim Meyering
The preceding commands ignored .[ch] files in lib/ and gl/. This is what I should have been doing from the start: git grep -l '`.*'\' $(g ls-files |grep '\.[ch]$') \ | xargs perl -pi -e 's/`(.+?'\'')/'\''$1/'
2012-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright".
2011-12-03maint: add missing ":" after "License" in local gnulib module filesJim Meyering
This avoids spurious diagnostics when running our "bootstrap" script. * gl/modules/heap: Append colon after "License". * gl/modules/randint: Likewise. * gl/modules/randperm: Likewise. * gl/modules/randread: Likewise. Reported by Stefano Lattarini. Diagnosed by Bruno Haible.
2011-10-30maint: avoid new "make syntax-check" failure due to stdalign definitionJim Meyering
* gl/modules/randread (Depends-on): Add stdalign. * gl/lib/randread.c: Include <stdalign.h>, so we can ... [!_STRING_ARCH_unaligned]: remove definition of stdalign.
2011-10-27build: avoid bootstrap failure when using patch-2.5.8Jim Meyering
* gl/modules/tempname.diff: Regenerate to correct bogus offsets and adjust for 1-line offset. Eric Blake reported that this patch failed to apply when using patch-2.5.8. Note that it applies fine using patch-2.6.1.
2011-09-17randread: add FIXME comment for RDRANDPaul Eggert
* gl/lib/randread.c: Add a FIXME comment suggesting how to improve performance by using the RDRAND hardware instruction.
2011-08-30build: heap.c: make possible gnulib candidate c89 compatiblePádraig Brady
* gl/lib/heap.c: Move declaration to the top of scope. Reported by Rob McMahon and Wolfgang Steinwender in relation to "Sun WorkShop 6 update 2 C 5.3 Patch 111679-12 2003/05/18" and "GCC 2.95.3" respectively.
2011-08-08mktemp: stir in enough entropy (Bug#6683)Paul Eggert
* gl/lib/tempname.c.diff (gen_tempname_len): Use x_suffix_len bytes' worth of entropy, not 8 bytes.
2011-07-02maint: use "const" and "pure" function attributes where possibleJim Meyering
* configure.ac (WARN_CFLAGS): Add -Wsuggest-attribute=const, -Wsuggest-attribute=pure and -Wsuggest-attribute=noreturn. (GNULIB_WARN_CFLAGS): But do not add them here... yet. * src/chown-core.h (chopt_free, uid_to_name): Add function attribute(s). * src/copy.c (is_ancestor, valid_options): Likewise. * src/copy.h (chown_failure_ok): Likewise. * src/dd.c (operand_matches, operand_is): Likewise. * src/df.c (selected_fstype, excluded_fstype): Likewise. * src/expr.c (null looks_like_integer): Likewise. * src/md5sum.c (hex_digits): Likewise. * src/od.c (get_lcm): Likewise. * src/pathchk.c (component_start, component_len): Likewise. * src/pinky.c (count_ampersands): Likewise. * src/pr.c (cols_ready_to_print): Likewise. * src/ptx.c (search_table): Likewise. * src/sort.c (find_unit_order): Likewise. * src/stty.c (mode_type_flag, string_to_baud, baud_to_value): Likewise. * src/system.h (gcd, lcm): Likewise. * src/tr.c (is_char_class_member, look_up_char_class): Likewise. (star_digits_closebracket): Likewise. * src/uniq.c (find_field): Likewise. * src/wc.c (compute_number_width): Likewise. * lib/xfts.h (cycle_warning_required): Likewise. * gl/lib/randint.h (randint_get_source): Likewise. * gl/lib/randperm.c (ceil_lg): Likewise. * gl/lib/randperm.h (randperm_bound): Likewise. * lib/strnumcmp.h (strintcmp): Likewise.
2011-06-17maint: use modules/tempname.diff file, not a replacement; update gnulibJim Meyering
Using a .diff is much more maintainable. Otherwise, changes in the gnulib module description file may not be noticed and merged promptly and may even result in subtle errors. Luckily, this time, the failure to propagate gnulib's changes to modules/tempname resulted only in an obvious link failure. * gl/modules/tempname: Remove file. * gl/modules/tempname.diff: Use a .diff file instead. * gnulib: Update submodule to latest.
2011-05-29maint: remove unnecessary gnulib .diff fileJim Meyering
* gl/modules/getloadavg.diff: Remove file. It stopped being useful back in February. * Makefile.am (EXTRA_DIST): Remove it.
2011-05-26maint: enforce cpp indentation policyJim Meyering
* cfg.mk (sc_preprocessor_indentation): New test, from libvirt. Exempt 3 files from new cppi test. * gl/lib/randread.c: Adjust cpp indentation to comply. * src/extent-scan.c (extent_need_sync): Likewise.
2011-05-14shuf: use memory more efficiently when returning a subsetPádraig Brady
* gl/lib/randperm.c (randperm_new): When the number of items to return H, is much smaller than the total number of items N, use a hash to represent the sparse permutations of the set N. This is currently enabled for N > 128K and N/H > 32. * tests/misc/shuf: Ensure shuf can quickly return 2 numbers from a large range. * gl/modules/randperm: Depend on hash. * NEWS: Mention the change.
2011-04-11maint: remove doubled words in comments, e.g., s/to to/to/Jim Meyering
* tests/ls/color-norm: s/to to/to/ * gl/lib/mbsalign.h (mbs_align_t): s/or or/or/ * src/extent-scan.c (extent_scan_read): s/the the/the/ * src/libstdbuf.c: s/the the/the/ * tests/misc/stdbuf: s/on on/on/ * ChangeLog-2005: s/for\n\tfor /for\n\t/
2011-03-13maint: use wcswidth from gnulibPádraig Brady
* gl/lib/mbsalign.c (rpl_wcswidth): Remove this in favor of the equivalent wcswidth replacement in gnulib. * bootstrap.conf: Depend on the wcswidth module. Suggested by Bruno Haible.
2011-02-08tests: randread-tests: use macro.h not "#define ASSERT..."Jim Meyering
* gl/modules/randread-tests (Files): Add tests/macros.h * gl/tests/test-rand-isaac.c: Remove now-unneeded #include directives. (ASSERT): Remove definition. Instead, include "macros.h". Prompted by suggestions from Bruno Haible.
2011-02-07maint: move di-set and ino-map modules from ./gl to gnulibJim Meyering
* gl/lib/di-set.c: Remove file. * gl/lib/di-set.h: Likewise. * gl/lib/ino-map.c: Likewise. * gl/lib/ino-map.h: Likewise. * gl/modules/di-set: Likewise. * gl/modules/di-set-tests: Likewise. * gl/modules/ino-map: Likewise. * gl/modules/ino-map-tests: Likewise. * gl/tests/test-di-set.c: Likewise. * gl/tests/test-ino-map.c: Likewise. * gnulib: Update to latest, now that these two modules are there.
2011-02-07di-set: provide a lookup methodJim Meyering
This is required for patch, and hence is about to move to gnulib. * gl/lib/di-set.c (di_set_lookup): New function. * gl/lib/di-set.h: Declare it. * gl/tests/test-di-set.c (main): Exercise it. The bug was introduced on 2004-12-04 via commit 7380cf79.
2011-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright".
2010-11-15maint: add a missed fadvise-tests modulePádraig Brady
* gl/modules/fadvise-tests: Add the module previously missed in commit 63b5e816, 2010-07-14, "fadvise: new module ...". * gl/tests/test-fadvise.c: Add a comment as to why we don't check return values.
2010-11-13maint: remove fstimeprec (variable precision time stamp) supportJim Meyering
The implementation of variable-precision time stamps relied on heuristics that made the output subtly nondeterministic, or at least hard to reproduce: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/21531/focus=21538 So, for now at least, we're removing that feature. * bootstrap.conf (gnulib_modules): Remove fstimeprec. * gl/lib/fstimeprec.c, gl/lib/fstimeprec.h: Remove files. * gl/modules/fstimeprec, gl/modules/fstimeprec-tests: Likewise. * gl/tests/test-fstimeprec.c: Remove file.
2010-11-06stat: use e.g. %.3X instead of %X.%3:X for sub-second precisionPaul Eggert
* NEWS: Document this. * doc/coreutils.texi (stat invocation): Likewise. * gl/lib/fstimeprec.c, gl/lib/fstimeprec.h, gl/modules/fstimeprec: * gl/modules/fstimeprec-tests, gl/tests/test-fstimeprec.c: New files. * bootstrap.conf (gnulib_modules): Add fstimeprec. * src/stat.c: Include fstimeprec.h. Don't include xstrtol.h. (decimal_point, decimal_point_len): New static vars. (main): Initialize them. (epoch_sec, out_ns): Remove. (out_int, out_uint): Now returns whatever printf returned. (out_minus_zero, out_epoch_secs): New functions. (print_stat): Use out_epoch_sec instead of out_ns and epoch_sec. (print_stat, print_it, usage): Remove the %:X-style formats. * tests/misc/stat-nanoseconds: Set TZ=UTC0 to avoid problems with weird time zones. Use a time stamp near the Epoch so that we don't have to worry about leap seconds. Redo test cases to match new behavior. * tests/touch/60-seconds: Change %Y.%:Y to %.9Y, to adjust to new behavior.
2010-10-13mbsalign: avoid warning with Solaris 10 ccPaul Eggert
* gl/lib/mbsalign.c: Include <stdint.h> for SIZE_MAX. Use SIZE_MAX rather than (size_t) -1, to avoid warning for "size_t x = -1" on Solaris 10 cc. * gl/modules/mbsalign (Depends-on): Add stdint.
2010-10-13tests: fix rand-isaac testPaul Eggert
* gl/tests/test-rand-isaac.c (main): Fix swapped arguments to strtol.
2010-10-01maint: ensure the mbsalign module is C89 compatiblePádraig Brady
This module may be moved to gnulib at some stage, so keep it C89 compatible. * gl/lib/mbsalign.c (mbsalign): Declare variables at start of scope (ambsalign): Likewise * gl/lib/mbsalign.h: Remove trailing comma from enum Reported by Andrei Suhan
2010-08-15maint: exclude tests from the set_program_name syntax-checkPádraig Brady
* .x-sc_program_name: Exclude all current and future c files in gl/tests from this check * gl/tests/test-di-set.c: Remove the hack to work around the set_program_name syntax-check * gl/tests/test-ino-map.c: Likewise * gl/tests/test-rand-isaac.c: Likewise
2010-08-09tests: silence 'make syntax-check'Eric Blake
* gl/tests/test-rand-isaac.c (main): Avoid warnings from syntax-check.
2010-07-25sort: make struct heap privatePaul R. Eggert
* gl/lib/heap.c (struct heap): Move this here... * gl/lib/heap.h (struct heap): ... from here, as outside code no longer needs to access any of these members.
2010-07-25sort: use more-consistent style with constPaul R. Eggert
* src/sort.c (proctab_hasher, proctab_comparator, stream_open, xfopen): (open_temp, zaptemp, struct_month_cmp, begfield, limfield): (find_unit_order, human_numcompare, numcompare, general_numcompare): (count_tabs, keycompare, compare, compare_nodes, lock_node): (unlock_node, queue_destroy, queue_init, queue_insert, queue_pop): (write_unique, mergelines_node, check_insert, update_parent): (merge_loop, sortlines, struct thread_args, set_ordering): Prefer the style "T const" to "const T". * gl/lib/heap.h (struct heap, heap_alloc): Likewise. * gl/lib/heap.c (heap_default_compare, heapify_down, heapify_up): (heap_alloc): Likewise.
2010-07-23randread: run 2x faster on 64-bit hosts, don't assume no padding bitsPaul R. Eggert
* gl/lib/rand-isaac.c: Remove the I/O; this belongs elsewhere. Add support for ISAAC64. Port to hosts with padding bits. Add self to author list. Include <limits.h>, for CHAR_BIT. Don't include string.h, sys/time.h, unistd.h. (min, just): New functions. (IF32): New macros. (ind, ISAAC_STEP, isaac_refill, mix, isaac_init, isaac_seed): Add support for ISAAC64. Port to hosts with padding bits. (ind): Now an inline function rather than a macro; no need for it to be a macro with modern compilers. (ISAAC_STEP): Renamed from isaac_step, since it's not function-like. Don't bother to pass args that are always the same. All uses changed. (ISAAC_STEP, ISAAC_SEED): Move to inside the only function body that can use it. (ISAAC_MIX): Renamed from isaac_mix, since it's now a macro and is no longer function-like. Don't bother saving and restoring state; no longer needed now that we're not a function. All uses changed. (isaac_seed_start, isaac_seed_data, isaac_seed_finish): Remove. (isaac_seed): Take just the one arg; the caller now sets s->m. * gl/lib/rand-isaac.h: Use _GL_RAND_ISAAC_H to protect, instead of RAND_ISAAC_H. Try out " #" rather than "# " for indenting. (ISAAC_BITS_LOG, ISAAC_BITS): New macros. (ISAAC_WORDS_LOG): Renamed from ISAAC_LOG. (isaac_word): New type. All uses of uint32_t changed to isaac_word, to support ISAAC64. (struct isaac_state): Rename member MM to M, and make it public. (isaac_seed, isaac_refill): Adjust to new API. * gl/lib/randread.c: Include sys/time.h. (get_nonce): New function, containing the nonce stuff that used to be in rand-isaac.c but better belongs here. (randread_new): Use it. * gl/modules/randread (Depends-on): Add inline. * gl/modules/randread-tests: New file. * gl/tests/test-rand-isaac.c: New file.
2010-07-22fadvise: new module providing a simpler interface to posix_fadvisePádraig Brady
* bootstrap.conf: Include the new module * gl/lib/fadvise.c: Provide a simpler interface to posix_fadvise. (fadvise): Provide hint to the whole file associated with a stream. (fdadvise): Provide hint to the specific portion of a file associated with a file descriptor. * gl/lib/fadvise.h: Redefine POSIX_FADV_* to FADVISE_* enums. * gl/modules/fadvise: New file. * m4/jm-macros.m4: Remove the no longer needed posix_fadvise check. * .x-sc_program_name: Exclude test-fadvise.c from this check. * gl/tests/test-fadvise (main): New test program. * gl/modules/fadvise-testss: A new index to reference the tests. * src/sort.c (stream_open): Use the new interface. * src/dd.c (iwrite): Likewise.
2010-07-20randread: use /dev/urandom to seed, not just getpid etcPaul R. Eggert
* gl/lib/rand-isaac.c (isaac_seed_start): New arg SEEDED. (isaac_seed): New args FD and BYTES_BOUND. Read from FD if possible. Don't bother with low-quality sources if FD has enough bytes. * gl/lib/rand-isaac.h: New size_t arg for isaac_seed. * gl/lib/randread.c: Include fcntl.h, unistd.h. (NAME_OF_NONCE_DEVICE): New #define. (nonce_device): New static var. (randread_new): Use nonce device if available.