summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-10-25pr: fix -n to pad consistently and not crashPádraig Brady
* src/pr.c: Replace the code to truncate the most significant digits of line numbers, with much simpler string manipulation that supports arbitrary widths. Before this, specifying a width >= 32 to -n would result in a divide by zero error. Also remove the inconsistent padding with zeros and spaces, which would result in zero padding for widths 12 and 15. * tests/pr/pr-tests.pl: Added a test to ensure no zero padding, and also a test for the divide by zero case. * NEWS: Mentioned the fix Reported by Ondrej Oprala
2012-10-25build: ensure factor links the iconv libraryPádraig Brady
* src/local.mk (src_factor_LDADD): Append $(LIBICONV). * crg.mk (sc_check-I18N-AUTHORS): A new syntax check rule to ensure we add LIBICONV where appropriate. * THANKS.in: Add the reporter. Reported by Christian Jullien Syntax check suggested by Jim Meyering
2012-10-25maint: refactor tests/misc/pr.pl into tests/pr/pr-tests.plPádraig Brady
* tests/misc/pr.pl: Refactor this test into ... * tests/pr/pr-tests.pl: ... here. * tests/local.mk: Remove the reference to the removed test Improved by Jim Meyering
2012-10-24build: do not redefine _FORTIFY_SOURCEMike Frysinger
When _FORTIFY_SOURCE is defined by the compiler or via flags, as it is on Gentoo, do not override it. Otherwise we get many redefinition warnings. * configure.ac (FORTIFY_SOURCE): Check if _FORTIFY_SOURCE is defined. This addresses http://bugs.gnu.org/12714
2012-10-23maint: post-release administriviaPádraig Brady
* NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
2012-10-23version 8.20Pádraig Brady
* NEWS: Record release date.
2012-10-23factor: add commentsJim Meyering
* src/factor.c (is_square): Use active voice in comment, not passive. (factor): Add function-describing comment. (mp_factor): Likewise.
2012-10-23build: avoid warnings about unused variables and macrosPádraig Brady
src/factor.c (__GMP_DECLSPEC): Move back from longlong.h to treat consistently with other stub macros. (__GMP_GNUC_PREREQ): Reference to avoid -Wunused-macros warning. (__GMP_DECLSPEC): Likewise. (ASSERT): Likewise. (__clz_tab): Likewise. (factor_using_division): Mark a variable as unused. (mulredc): Likewise. (mulredc2): Likewise. (divexact_21): Likewise.
2012-10-23build: avoid compile warnings in factor.c on some systemsPádraig Brady
* src/factor.c (factor_using_pollard_rho2): On some systems (like sparc) we need to promote all addmod2() parameters to uintmax_t to avoid warnings.
2012-10-23build: avoid build failure on some sparc systemsPádraig Brady
* src/longlong.h: Restrict some sparc assembly variants to sparc V9. This was seen to be an issue with newer sparc systems with default gcc CPU options.
2012-10-23tests: correctly restrict factor test without GMPPádraig Brady
* tests/misc/factor.pl: Correct the precedence and regular expression in the command to check for GMP.
2012-10-21doc: NEWS: the cp bug affects mv and install, tooJim Meyering
* NEWS (Bug fixes): Note that the copy-induced corruption but affects mv (sometimes) and install, too. Pointed out by Bernhard Voelker.
2012-10-19doc: remove a stray parenthesis from 'cp --force' descriptionBenno Schulenberg
* doc/coreutils.texi (cp invocation): Remove Cheshire Cat.
2012-10-17build: update gnulib submodule to latestJim Meyering
2012-10-17cp: avoid data-corrupting free-memory-readJim Meyering
* src/extent-scan.c (extent_scan_read): Reset our last_ei pointer whenever the parent buffer might have just been freed. * tests/cp/fiemap-extent-FMR.sh: New test. * tests/local.mk (all_tests): Add it. * NEWS (Bug fixes): Mention it. Reported by Mike Gerth in http://bugs.gnu.org/12656, and with help from Alan Curry. Bug introduced in commit v8.10-60-g18f5a85.
2012-10-13doc: improve HACKING guidelinesNikolas Kallis
* HACKING: Add "cd coreutils" after the git clone command. Copyright-paperwork-exempt: Yes
2012-10-09factor: fix integer validation and GMP fallbackPádraig Brady
In the recent factor rewrite, the GMP code wasn't actually used; just an error was printed on integer overflow. While fixing that it was noticed that correct input validation wasn't done in all cases when falling back to the GMP code. * src/factor.c (print_factors) Fallback to GMP on overflow. (strto2uintmax): Scan the string for invalid characters, so that case can be detected independently of overflow. Return an error when an empty string is passed. Also allow leading spaces and '+' in input numbers. * tests/misc/factor.pl: Ensure the GMP code is exercised when compiled in. Also add a test to verify leading spaces and '+' are allowed.
2012-10-08build: support older GMP versionsPádraig Brady
The new factor code introduced usage of mpz_inits() and mpz_clears(), which are only available since GMP >= 5, and will result in a compile error when missing. * m4/gmp.m4 (cu_GMP): Define HAVE_DECL_MPZ_INITS appropriately. * src/factor (mpz_inits): New function, defined where missing. (mpz_clears): Likewise.
2012-10-07maint: avoid warning from gcc's -Wunused-macrosJim Meyering
On some systems, -Wunused-macros would warn about two macros: src/factor.c:148:0: warning: macro "__clz_tab" is not used src/factor.c:126:0: warning: macro "UHWtype" is not used * src/factor.c: Add a use to placate gcc.
2012-10-05build: avoid link failure when strerror is replacedJim Meyering
When building the new make-prime-list program on a system for which strerror is defined to rpl_strerror, we'd get a link failure. The problem is that we're including <config.h> for some definitions, but do not want the rpl_ ones, since this particular program must not be linked against gnulib (aka libcoreutils.a). This did not arise on Fedora 17 or 18, but did on Debian wheezy/sid. * src/make-prime-list.c (strerror): #undef. Build failure introduced by commit v8.19-152-gcf67e4c.
2012-10-04factor: 25% speed-up, on outputJim Meyering
* src/factor.c (print_factors_single): Use fputs and umaxtostr rather than printf with "%ju". This reduced the time required to compute and print the factors of the first 10^7 integers from over 8 seconds to 5.75s. Run this command: seq $((10**7)) | env time factor > /dev/null
2012-10-04factor: merge with preexisting factor; integrate tests; avoid warningsJim Meyering
* src/factor.c: Renamed from factor-ng.c, with the following changes: Adjust copyright header to be consistent with others. Use xmalloc and xrealloc, to avoid segv upon OOM. Switch back to using readtokens to handle input. Diagnose invalid inputs. s/fprintf+exit/error/ (print_factors): Add comments. (strto2uintmax): Return strtol_error, not int. (read_item): Remove, no longer used. (main): Use atexit(close_stdout) so that we don't ignore failed write. * cfg.mk: Exempt src/longlong.h from several tests. Exempt run.sh from the test-list-consistency test. Exempt make-prime-list.c from numerous tests, since we won't be making it conform: it must not link with libcoreutils.a. Exempt factor-ng.c from the no-upper-case error message test. * AUTHORS (factor): Add Torbjörn and Niels. * tests/local.mk (factor_tests): Encode the 37 tests. ($(factor_tests)): Rule to generate a test script for each test. * tests/factor/run.sh: New script, marked as very expensive. * .gitignore: Ignore new generated files. * src/local.mk (src/primes.h): New rule. (noinst_PROGRAMS): Add make-prime-list. (noinst_HEADERS): Add longlong.h. Remove all wheel-related rules and files. * src/wheel-gen.pl: Remove file. maint: mark set-but-not-used variables with ATTRIBUTE_UNUSED * src/factor-ng.c (redcify, prime_p, isqrt2): Mark them, so we don't have to disable -Wunused-but-set-variable. maint: use __builtin_expect only if __GNUC__ * src/factor-ng.c (LIKELY, UNLIKELY) [__GNUC__]: Add #ifdef guard. build: avoid warning about unused macro * src/factor-ng.c (__GMP_DECLSPEC): Don't define here * src/longlong.h (__GMP_DECLSPEC): Define if not already defined.
2012-10-04factor: more improvementsNiels Möller
* src/factor-ng.c: Import some improvements from http://gmplib.org:8000/factoring Co-authored-by: Torbjörn Granlund <tg@gmplib.org>
2012-10-04factor: new much-improved implementation; not yet integratedTorbjörn Granlund
* src/factor-ng.c: New file, from nt-factor. * src/longlong.h: New file. * NEWS (Improvements): Mention the upcoming improvements. Co-authored-by: Niels Möller
2012-10-04maint: make-prime-list: syntax conventions; be robust for large NJim Meyering
* src/make-prime-list.c: Insert spaces before parens. (main): Abort if the 8-delta value ever exceeds 255.
2012-10-04maint: make-prime-list: do not ignore write failureJim Meyering
Even though this is just a helper program that is run solely to create primes.h, it should not ignore a write failure. Normally we would simply call atexit (close_stdout), but we cannot do that from this helper program, since it must be built before the generated header, primes.h. If we were to make the linking of make-prime-list depend on libcoreutils.a, that would add all lib/*.o files to the list of dependents of $(BUILT_HEADERS). Then, since there is currently no provision to ensure that a file like lib/stdio.h (another built header) is built before the first lib/*.o file that also includes <stdio.h>, some lib/*.o files would be built before lib/stdio.h and some after. The former would provoke link failures due to undefined rpl_* functions. * src/make-prime-list.c: Include <errno.h>. (fclose): Undef, so that a definition to rpl_fclose does not cause a link failure. (main): Per the above, in this exceptional case, we check for fclose and ferror failure manually, and don't worry about the ferror-only failure case in which errno may not be relevant.
2012-10-04maint: make-prime-list: avoid -Wsuggest-attribute=const warningJim Meyering
* src/make-prime-list.c: Include <config.h>. (binvert): Add _GL_ATTRIBUTE_CONST.
2012-10-04factor: prepare for the new factor programTorbjörn Granlund
* src/make-prime-list.c: New file, from nt-factor. Co-authored-by: Niels Möller <nisse@lysator.liu.se>
2012-10-03build: remove redundant dependency: $(PROGRAMS): lib/libcoreutils.aJim Meyering
* src/local.mk: Remove the above dependency. A soon-to-be-added new program, make-prime-list, must not depend on that, since it is used to create a BUILT_SOURCES file. That dependency is already handled via the ..._LD_ADD variables, and so that redundant dependency has so far been harmless.
2012-09-30du: avoid abort on systems for which ->me_type is not malloc'dJim Meyering
On some systems (notably, BSD-based, like at least OpenBSD 4.9), the me_type member does not come from the heap. * src/du.c (fill_mount_table): Free the ->me_type member only when it was malloc'd, i.e., when ->me_type_malloced is nonzero. Bug introduced via commit v8.19-2-gcf7e1b5. Reported as http://bugs.gnu.org/12542.
2012-09-29doc: same correction, but now in texinfo documentationJim Meyering
* doc/coreutils.texi (nice invocation): s/nicenesses/niceness values/
2012-09-28doc: correct an old bit of ugliness in nice --help outputJim Meyering
* src/nice.c (usage): s/Nicenesses/Niceness values/
2012-09-28doc: disambiguate the niceness explanation in nice --helpPádraig Brady
* src/nice.c (usage): Specify the entity (process) that that relative terms are referring to. * THANKS: Update. Reported-by: David Diggles
2012-09-28cp: fix the --no-preserve=mode optionOndrej Oprala
The --no-preserve=mode option did not do what its name implies: it would mistakenly preserve permission mode bits. * NEWS: Mention the fix. * TODO: Remove an entry. * src/copy.c (copy_reg): Add a condition to properly handle the --no-preserve=mode option for files (copy_internal): Add a condition to properly handle the --no-preserve=mode option for directories. * src/copy.h (struct cp_options): Add a new boolean. * src/cp.c (cp_option_init,decode_preserve_arg): Set the new boolean value according to specified options. * src/install.c (struct cp_options): Initialize the new boolean. * src/mv.c (struct cp_options): Initialize the new boolean. * tests/cp/preserve-mode.sh: Add a new test. * tests/cp/link-preserve.sh (-a --no-preserve=mode): Adjust the expected perms: now, --no-preserve=mode overrides the --preserve=mode that is inherent in -a, as it should. * tests/local.mk: Add the new test to the list.
2012-09-24timeout: handle signals more transparentlyPádraig Brady
This was originally attempted in commit v8.12-117-g5a647a0, but reverted before release because of the unreliability of disabling core dumps using setrlimit() on Linux kernels. This new version instead uses prctl() where available to more reliably disable core dumps for the timeout process. * m4/jm-macros.m4: Define HAVE_SETRLIMIT and HAVE_PRCTL. * src/timeout.c (disable_core_dumps): A new function that disables coredumps using prctl or setrlimit if available. (main): If the child exited with a signal and we can disable core dumps, then raise that signal to the timeout process itself, so that callers may also see the signal status. Also print a message indicating when the monitored command dumped core, as that information is lost in the signal propagation through timeout.
2012-09-24dd: new option, status=none to suppress output statisticsPozsár Balázs
* src/dd.c (STATUS_NONE): A new bitmask combining all STATUS_ options, thus used to suppress all informational output. (struct symbol_value statuses): Expose the "none" option, corresponding to the STATUS_NONE bitmask above. (print_stats): Return early if STATUS_NONE is specified. Also move the call to gethrxtime() down so that it's only called when needed. (usage): Describe the new options. * doc/coreutils.texi (dd invocation): Likewise. * NEWS: Mention the new feature. * tests/dd/misc.sh: Ensure the new option works.
2012-09-23tail,stat: improve support for vmhgfsJim Meyering
Teach tail -f that it must use polling on vmhgfs file systems, and let stat -f --format=%T report the file system type name, "vmhgfs". * src/stat.c (human_fstype): Add a case: vmhgfs, 0xbacbacbc, remote. * NEWS (Improvements): Mention it. * THANKS.in: Update. Reported by Daniel Tschinder in http://bugs.gnu.org/12461.
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-19rm: be even more careful when using a replacement errno valueJim Meyering
* src/remove.c (excise): The change in commit v8.19-107-gccbd3f3 made the "rm -rf D" (for unreadable dir, D) diagnostic worse on Solaris 10: -rm: cannot remove 'D': Permission denied +rm: cannot remove 'D': File exists That happened because unlinkat would fail with EEXIST there, given an unreadable directory, which made the two tests, tests/rm/unread2 and tests/rm/unreadable fail. Accommodate the EEXIST case, too.
2012-09-19maint: fix a comment typoJim Meyering
* cfg.mk: Fix comment typo: s/recursive/non-recursive/ make
2012-09-18tests: cp/link-heap: avoid new failure on rawhideJim Meyering
* tests/cp/link-heap.sh: Increase virtual memory limit by 2000KiB -- from 20,000 to 22,000 KiB -- to avoid a new failure on rawhide.
2012-09-18maint: make the tight-scope syntax-check rule work againJim Meyering
* cfg.mk: Configure a few variable to make the tight-scope rule work. * gnulib: Update submodule to latest.
2012-09-18dd: remove references to the word BLOCKS from help and texi docsBenno Schulenberg
The renaming from BLOCKS to N was done in v8.15-38-g140eca1, and documentation for N was added again in v8.17-26-g4f2e9d5 without noticing that. Now, finally remove the word BLOCKS from the documentation. * src/dd.c (usage): Remove the word BLOCKS. * doc/coreutils.texi (dd invocation): Likewise. Improved by: Bernhard Voelker <mail@bernhard-voelker.de>
2012-09-18doc: NEWS: mention the conversion to non-recursive makeJim Meyering
* NEWS (Build-related): Mention the non-recursive make improvement. Improved by: Pádraig Brady
2012-09-16ls: fix coloring of dangling symlinks in default listing modePádraig Brady
When listing a directory containing dangling symlinks, and not outputting a long format listing, and orphaned links are set to no coloring in LS_COLORS, then the symlinks would get no color rather than reverting to the standard symlink color. The issue was introduced in v8.13-19-g84457c4 * src/ls.c (print_color_indicator): Use the standard method to check if coloring is specified for orphaned symlinks. The existing method would consider 'or=00' or 'or=0' as significant in LS_COLORS. Even 'or=' was significant as in that case the string='or=' and the length=0. Also apply the same change for missing symlinks for consistency. (gobble_file): Remove the simulation of linkok, which is only tested in print_color_indicator() which now handles this directly by keying on the LS_COLORS values correctly. * tests/misc/ls-misc.pl: Add a test case. * THANKS: Add the reporter. * NEWS: Mention the fix. Reported-by: David Matei
2012-09-15doc: update seq descriptionJim Meyering
* doc/coreutils.texi (seq invocation): Update an example and mention that with the new constraints, seq can print arbitrarily large numbers.
2012-09-14seq: enable the fast integer printing code in more casesPádraig Brady
* src/seq.c (main): Adjust the initial arbitrary precision seq_fast enablement checks to be more maintainable, and a little more general, by allowing single character separators to use seq_fast. Also check again after the number arguments are processed, to see if we can still use seq_fast, which while not allowing arbitarly large integers, it will handle integers of the form 10E10 etc. (seq_fast): Use a specified separator character, rather than hardcoding '\n'.
2012-09-14build: do not rely on automake's AM_TESTS_ENVIRONMENTJim Meyering
* tests/local.mk (TESTS_ENVIRONMENT): Rename from AM_TESTS_ENVIRONMENT, since it is not honored in automake-1.11.3 after all. This reverts commit v8.19-38-g34c9c8f. For now, I'll leave the following commit that made bootstrap.conf require 1.11.2. Prompted by a report of test failure from Pádraig Brady.
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-14seq: 70x faster for non-negative whole numbers and incr==1Jim Meyering
Handle non-negative whole numbers robustly and efficiently when the increment is 1 and when no format-changing option is specified. On the correctness front, for very large numbers, seq now works fine: $ b=1000000000000000000000000000 $ src/seq ${b}09 ${b}11 100000000000000000000000000009 100000000000000000000000000010 100000000000000000000000000011 while the old one would infloop, printing garbage: $ seq ${b}09 ${b}11 | head -2 99999999999999999997315645440 99999999999999999997315645440 The new code is much more efficient, too: Old vs new: 55.81s vs 0.82s $ env time --f=%e seq $((10**8)) > /dev/null 55.81 $ env time --f=%e src/seq $((10**8)) > /dev/null 0.82 * seq.c (incr): New function, inspired by the one in cat.c. (cmp, seq_fast): New functions, inspired by code in nt-factor by Torbjörn Granlund and Niels Möller. (trim_leading_zeros): New function, without which cmp would malfunction. (all_digits_p): New function. (main): Hoist the format_str-vs-equal_width check to precede first treatment of operands, and insert code to call seq_fast when possible. * NEWS (Bug fixes): Mention the correctness fix. (Improvements): Mention the speed-up. * tests/misc/seq.pl: Exercise the new code. Improved by: Bernhard Voelker. http://thread.gmane.org/gmane.comp.gnu.coreutils.general/3340