summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-12-14maint: fix typos found by misspellingsBernhard Voelker
* doc/coreutils.texi (df invocation): s/occurence/occurrence/. * tests/df/skip-rootfs.sh: s/supressed/suppressed/
2012-12-09tests: add test case and note that last week's cut change is a bug fixJim Meyering
* tests/misc/cut-huge-to-eol-range.sh: New test, showing that the change in v8.20-51-g7d03466 is a bug fix after all. * tests/local.mk (all_tests): Add it. * NEWS (Bug fixes): Mention it.
2012-12-08cp: fix --no-preserve=mode to not exit 1Bernhard Voelker
cp --no-preserve=mode exited 1 unconditionally. Furthermore, the tests which would have detected this error - namely link-preserve.sh and reserve-mode.sh - failed to test cp's exit code. * src/copy.c (copy_reg): In the case x->explicit_no_preserve_mode, do only set return_val to false iff the previous set_acl () failed. * tests/cp/link-preserve.sh: Check cp's exit code. * tests/cp/link-symlink.sh: Likewise. * tests/cp/preserve-mode.sh: Likewise. * NEWS: Mention the fix. Bug introduced in commit v8.19-145-g24ebca6. Reported by Florian Pritz in http://bugs.gnu.org/13119.
2012-12-07df: do not print duplicate entries and rootfs by defaultOndrej Oprala
* src/df.c (struct devlist): Add new struct for storing already- examined device numbers. (devlist_head): Add new store of the above type. (show_rootfs): Add new global boolean to not skip rootfs. (dev_examined): Add new function to check if the device has already been traversed. (get_dev): Filter out rootfs unless "-t rootfs" or the -a option is specified. Filter out duplicate entries by calling the above new dev_examined unless the -a option is specified. (main): Set the show_rootfs variable appropriately when the -t option is specified for rootfs. Free device list (guarded by IF_LINT). * tests/df/skip-duplicates.sh: Add test to exercise the skipping of duplicate entries. * tests/df/skip-rootfs.sh: Add test to exercise the skipping of the rootfs pseudo file system. * tests/local.mk: Add the above new tests. * NEWS (Changes in behavior): Mention the changes. * doc/coreutils.texi (df invocation): Document df's behavior about skipping rootfs and duplicate entries. Co-authored-by: Bernhard Voelker.
2012-12-06cut: avoid a redundant heap allocationCojocaru Alexandru
* src/cut.c (set_fields): Don't allocate memory for `printable_field' if there are no finite ranges. This is achieved by keeping max_range_endpoint as 0 when there are no finite ranges. max_range_endpoint is then used throughout the code to guard against allocation of, and access to the bit array. The extra allocation was introduced via commit v8.10-3-g2e636af.
2012-12-06maint: fix a referenced coreutils version in a test commentPádraig Brady
* tests/misc/cut.pl: This particular bug existed up to v8.10.
2012-12-06tests: fix regex to match "-" in ipcent field in df/total-verify.shBernhard Voelker
The regular expression failed to match for file systems that do not provide inode statistics, e.g. VFAT or CIFS (depending on the underlying peer file system). * tests/df/total-verify.sh: Fix the regular expression to match a dash in the ipcent field again. Reported by Assaf Gordon in http://bugs.gnu.org/13099. Bug introduced in commit v8.20-18-gdae8d22.
2012-12-06maint: adjust HACKING instructions to run a single testAssaf Gordon
* HACKING: Adjust as per the recent changes introduced when switching to non recursive make.
2012-12-06tests: cut.pl: adjust for changed diagnosticPádraig Brady
* tests/misc/cut.pl: Since we now output the more complete error message irrespective of running in a multi-byte locale or not, adjust the test accordingly.
2012-12-06cut: improve error reportingCojocaru Alexandru
* src/cut.c (main): Treat a NUL delimiter (-d '') consistently with non NUL delimiters, and disallow such a delimiter option, unless a field is also specified. (set_fields): Provide a more accurate error message when a given list is invalid. * tests/misc/cut.pl: Add a test case.
2012-12-06maint: adjust instructions to run a single testPádraig Brady
* README: Adjust as per the recent changes introduced when switching to non recursive make.
2012-12-05maint: remove now auto-added entry from THANKS.inBernhard Voelker
The syntax-check sc_THANKS_in_duplicates complained about that excess entry. * THANKS.in (Colin Watson): Remove entry, now that it will be automatically included in the generated THANKS file.
2012-12-04maint: remove a redundant odd sized alloc from factor.cPádraig Brady
* src/factor.c (mp_factor_init): Init the pointers with NULL, which xrealloc (or realloc) handles fine.
2012-12-04factor: fix infinite loop on 32 bit powerpcColin Watson
Both Debian and Ubuntu builds of coreutils 8.20 hang while running the test suite on powerpc, which is reproducible using 'factor 122'. This turns out to be somewhat related to http://bugs.gnu.org/12754, but not quite the same. uintmax_t is 64 bits, but the cntlzw instruction takes 32-bit operands, and the cntlzd option is only available on 64-bit hardware. * src/longlong.h: Add an _LP64 check around the PPC64 code, so that this falls back to the C implementations. * NEWS: Mention the fix.
2012-11-24cut: do not print extraneous delimiters in some unusual casesJim Meyering
When printing output delimiters, and when a to-EOL range subsumes at least one other range, cut would mistakenly print delimiters for the subsumed range. This bug was probably introduced via commit v5.2.1-639-g847e066. * src/cut.c (set_fields): Ignore any range that is subsumed by a to-EOL range. Also, move two declarations down. * tests/misc/cut.pl: Add tests to exercise this. * NEWS (Bug fixes): Mention it. Reported by Marcel Böhme in http://bugs.gnu.org/12966
2012-11-24cut: treat -b2-,3- like -b2-, not like -b3-Jim Meyering
* src/cut.c (set_fields): When two right-open-ended ranges are specified, don't blindly let the latter one take precedence over the former. Instead, use the union of the ranges. * tests/misc/cut.pl: Add tests to exercise this. * NEWS (Bug fixes): Mention it. Reported by Marcel Böhme in http://bugs.gnu.org/12966 Thanks to Berhard Voelker for catching log and NEWS typos.
2012-11-24doc: cp: clarify behavior of the --preserve=xattr optionBernhard Voelker
* doc/coreutils.texi (cp invocation): Enhance documentation of the --preserve=xattr option regarding the preservation of ACLs, SELinux contexts and capabilities: the user may notice this only when not specifying --preserve=mode and --preserve=context, too, i.e., otherwise, these attributes are preserved anyway.
2012-11-24doc: update info cross reference to bashPádraig Brady
* doc/coreutils.texi (tee invocation): Reference the bash manual rather than bashref, as the latter is more likely to work on newer systems.
2012-11-24tests: use sub-second timeouts to speed up a timeout testPádraig Brady
* tests/misc/timeout.sh: Take advantage of recent support for sub-second timeouts to decrease runtime from about 6s to 2s.
2012-11-24doc: clarify that renice is needed to adjust nicenessPádraig Brady
* doc/coreutils.texi (nice invocation): Ensure there is no ambiguity in the summary in relation to nice being able to adjust the niceness of an existing process. Reference the renice command. * man/nice.x: Reference renice (1)
2012-11-24tests: accept EEXIST from rm -dPádraig Brady
* tests/rm/d-2.sh: EEXIST is a valid error on some systems. Reported by Michael Felt on AIX 6.1
2012-11-24tests: don't rely on sed -i being availablePádraig Brady
* tests/df/df-output.sh: sed --in-place is not generally available. Also add a couple of simplifications from Bernhard Voelker. Removing all spaces, rather than just leading spaces, suffices. Searching for ' --output' in unadjusted df --help, suffices.
2012-11-24seq: ensure correct output width for scientific notation inputPádraig Brady
* src/seq.c (scan_arg): Calculate the width more accurately for numbers specified using scientific notation. * tests/misc/seq.pl: Add tests for cases that were mishandled. * NEWS: Mention the fix. * THANKS.in: Reported by Marcel Böhme. Fixes http://bugs.gnu.org/12959
2012-11-22df: reorder default field list of --output optionBernhard Voelker
As the inodes information is usually not so much of interest, and some file systems including btrfs do not even provide it, reading of the full df --output is easier when the block statistic fields come just left of the last field, the mount point. * src/df.c (all_args_string): Move the inodes fields before the block fields. (usage): Likewise. * tests/df/df-output.sh: Likewise. * doc/coreutils.texi (df invocation): Likewise. Additionally, explicitly mention the default order of the --output option.
2012-11-20install: fix security racePaul Eggert
* NEWS: Document this.
2012-11-20install: fix security racePaul Eggert
* src/copy.c (copy_internal): Use DST_MODE_BITS, not SRC_MODE. See Bernhard R. Link in <http://bugs.gnu.org/12947> and in <http://bugs.debian.org/598018>.
2012-11-20nl: remove deprecated --page-increment optionBernhard Voelker
The above option has been deprecated since coreutils-7.5 by commit v7.4-129-g718b279. * src/nl.c (PAGE_INCREMENT_OPTION_DEPRECATED): Remove enum. (longopts): Remove "page-increment" entry. (main): Remove PAGE_INCREMENT_OPTION_DEPRECATED case. * NEWS (Changes in behavior): Mention the change. Reported by Marcel Böhme in <http://bugs.gnu.org/12940>.
2012-11-19doc: remove already implemented items from TODOBernhard Voelker
* TODO (renice): The renice program is part of util-linux for years now. Remove entry. (dd): The option status=none has been implemented in commit v8.19-143-g7331ab5. Remove entry.
2012-11-19cut: do not accept the invalid range 0-Bernhard Voelker
The command "echo 12345 | cut -b 0-" prints an empty line while it should fail with "fields and positions are numbered from 1". * src/cut.c (set_fields): Add a diagnostic for the invalid open range which starts with Zero, i.e., the range 0-. * tests/misc/cut.pl: Add tests to ensure the range 0- fails for fields (-f) and for positions (-b, -c). * NEWS: Mention the fix. Reported by Marcel Böhme in <http://bugs.gnu.org/12903>.
2012-11-18build: fix compilation failure on x32Daniel Schepler
* src/factor.c [HAVE_ATTRIBUTE_MODE]: Fix typo in #if test: s/HAVE_LONG_LONG/HAVE_LONG_LONG_INT/. Otherwise, factor.c would elicit assembler errors on x32: it was incorrectly defining DItype to long instead of long long. Patch and report in http://bugs.debian.org/693337; Mike Stone notified upstream.
2012-11-18maint: reenable accidentally-disabled cppi-check syntax-check ruleJim Meyering
* cfg.mk (exclude_file_name_regexp--sc_preprocessor_indentation): Fix typo that disabled the sc_preprocessor_indentation syntax-check rule by exempting all files. s/__ll/_ll/ The typo was introduced in commit v8.19-157-g759ebcb.
2012-11-18maint: correct indentation of W_TYPE_SIZE-defining cpp directivesJim Meyering
* src/factor.c: Indent cpp directives to reflect their nesting.
2012-11-18maint: avoid i686-specific syntax-check failureJim Meyering
* cfg.mk (_gl_TS_unmarked_extern_vars): Define.
2012-11-17doc: explain why dd is called "dd"Paul Eggert
* doc/coreutils.texi (dd invocation): Mention JCL.
2012-11-16factor: tidy up primes.h againPaul Eggert
See Stefano Lattarini in <http://bugs.gnu.org/12899>. * src/local.mk (BUILT_SOURCES): Put $(top_srcdir)/src/primes.h here (MAINTAINERCLEANFILES): ... instead of here.
2012-11-13factor: cleanup for primes.hPaul Eggert
* .gitignore: Add src/primes.h back, since it's no longer in the repository.
2012-11-13maint: avoid unnecessary #include to fix syntax-check failureJim Meyering
* src/factor.c: Remove unneeded #inclusion of"verify.h". It's already included via system.h.
2012-11-12factor: improve primes.h changePaul Eggert
This follows suggestions by Jim Meyering in <http://bugs.gnu.org/12841#34>. * src/make-prime-list.c (print_wide_uint): Change "nested" argument to "nesting", and use it to avoid outputting lines that are too long. * src/primes.h: Remove from git. This can be generated by a maintainer. It's nicer to do so on a host with at least 128-bit arithmetic.
2012-11-12factor: maintainer builds primes.h, not builderPaul Eggert
With this change, the maintainer builds primes.h and it is part of the tarball. primes.h's contents are not architecture-specific. * .gitignore: Remove /src/primes.h. * src/factor.c: Include verify.h. (W): New constant. Verify that uintmax_t lacks holes and that W is no wider than the integers used to generate primes.h. * src/local.mk (EXTRA_DIST): Add src/primes.h. (BUILT_SOURCES, CLEANFILES): Remove src/primes.h. ($(top_srcdir)/src/primes.h): Rename from src/primes.h. Do not depend on src/make-prime-list. Instead, use sub-make to build, so that we build primes.h only if it does not exist. * src/make-prime-list.c: Include <limits.h>, for ULONG_MAX. (wide_uint): Define to uintmax_t or unsigned __int128 if not #defined. (struct prime, binvert, process_prime): Use it instead of uintmax_t. (print_wide_uint): New function. This generates the proper pinv value regardless of the width of uintmax_t on the target, so long as the width doesn't exceed that of the width of wide_uint on the maintainer host that generated src/primes.h. (output_primes): Use it. Output WIDE_UINT_BITS, too. Let the target compute its own lim, since its uintmax_t may be narrower than ours. (SZ): Remove. * src/primes.h: New file, generated with 128-bit integers and usable on any host where uintmax_t's width is no greater than 128 bits.
2012-11-12factor: port to systems with rpl_mallocPaul Eggert
* src/make-prime-list.c (malloc): Undef. This fixes a problem on AIX 8.20 reported by Michael Felt in <http://bugs.gnu.org/12841>.
2012-11-09tests: fix factor's tests to use coreutil's own sha1sumBernhard Voelker
The test used the shasum utility which seems to belong to the perl package. On SLES-10.4, perl doesn't include this yet: + seq 0 10000000 + factor + shasum -c --status exp ./tests/factor/t00.sh: line 30: shasum: command not found + Exit 1 It is better to use our own stuff anyway. * tests/factor/run.sh: s/shasum/sha1sum/. Additionally, add sha1sum to the print_ver_ call.
2012-11-09doc: chcon: add descriptions for three undocumented optionsBenno Schulenberg
These were missed in this related change v8.14-104-g44e20cd * src/chcon.c (usage): Mention the two --preserve-root options. * doc/coreutils.texi (chcon invocation): Plus the --dereferece option.
2012-11-09doc: with cp -n, option -f is not redundant but ignoredBenno Schulenberg
* src/cp.c (usage): Replace "redundant" with "ignored". * doc/coreutils.texi (cp invocation): Likewise.
2012-11-09df: port the new df test to POSIX sed, larger file systemsPaul Eggert
* tests/df/df-output.sh: For the test "df -B1K --output=size", do not assume that the file system size fits in 9 bytes; it might be larger than that, so omit leading space. Also, use portable 'sed' commands: POSIX says sed commands inside { } should all end in newline.
2012-11-08df: add a test for the --output optionBernhard Voelker
* tests/df/df-output.sh: Add a test case. * tests/local.mk (all_tests): Mention the test. * cfg.mk (sc_file_system): Exempt the test from this syntax-check.
2012-11-08df: document the new --output optionBernhard Voelker
* src/df.c (usage): Add a short description of --output and its available field names for use in the optional argument. * doc/coreutils.texi (df invocation): Add the new option with more details and a few examples. * NEWS (New features): Mention the new option. (Changes in behvaior): Mention the new placeholder for fields in the "total" line.
2012-11-08df: add --output to select which fields to displayBernhard Voelker
This supports changing the order of the fields displayed, and also allows the simultaneous display of inode and block fields. src/df.c (get_dev): Factor out calling get_header to ... (main): ... here. Call print_table only if file_systems_processed. src/df.c (Displayable fields): Rename DEV_FIELD to SOURCE_FIELD. Rename TYPE_FIELD to FSTYPE_FIELD. Rename FREE_FIELD to AVAIL_FIELD. Rename MNT_FIELD to TARGET_FIELD. * src/df.c (display_field_t): Turn loose enum definition of the displayable fields into a typedef. Add the inode fields ITOTAL_FIELD, IUSED_FIELD, IAVAIL_FIELD, IPCENT_FIELD. (field_data_t): Define structure to hold the display field, the caption, the width and the alignment for each field of the above type. (field_data): Add array the values of field data for each display field. (headers, alignments, widths): Remove arrays. (columns): Add a pointer to the storage for the array of the actual output columns, i.e., fields. (ncolumns): Add counter for the current output columns. (alloc_table_row): Allocate the dynamic ncolumns value of strings. (print_table): Loop over ncolumns instead of constant NFIELDS. Rename loop variable 'field' to 'col' to avoid ambiguity with the 'field' element in the columns structure. Adjust the condition for printing the last column by comparing with the column number instead of the field name (TARGET_FIELD). Use the width and the alignment stored in the columns data. (alloc_field): Add new function to allocate a field in the columns array. (get_field_list): Add new function to fill the array of output columns for each mode. (get_header): Loop over ncolumns instead of constant NFIELDS. Rename the loop variable 'field' to 'col' to avoid ambiguity with the 'field' element in the columns structure. Remove the code for continuing the loop if the current column is the file system type and print_type is not active (which is now impossible). Store the cell in the columns store along with the new width. (get_dev): Loop over ncolumns instead of the constant NFIELDS. Rename the loop variable 'field' to 'col' to avoid ambiguity with the 'field' element in the columns structure; move the definition down to where it is used first. Add cases for the inode fields ITOTAL_FIELD, IUSED_FIELD, IAVAIL_FIELD and IPCENT_FIELD. Store the cell in the columns store along with the new width. (main): Use new get_field_list function to fill the list of output columns. * src/df.c (print_table): Instead of fputs()ing directly, apply ambsalign on the last field, too. Use the new MBA_NO_RIGHT_PAD flag for this. * src/df.c (TOTAL_OPTION): Add new enum value. (long_options): Use it for the "total" option instead of 'c'. (main): Likewise. * src/df.c (get_dev): Remove condition to copy the fstype into the FSTYPE_FIELD - based on whether print_type is non-Null. Since the introduction of get_field_list(), there are only fields added to the columns array which have to be added. * src/df.c (get_dev): Guard the summing up of the values for the grand total: only do it if we have to print the total and if the current invocation is not for processing it. * src/df.c (main): Pass a hyphen "-" for the mount point name to get_dev. (get_dev): As the mount_point is now always there, remove the condition and the else case for the TARGET_FIELD. Instead, simply copy the mount_point. All cells are now always present. Therefore, add an assertion statement if one was not. Furthermore, hide the problematic characters unconditionally. (print_table): Remove the skipping of empty cells. * tests/df/total-verify.sh: Accommodate to the new "-" in the target field of the summary line. * NEWS: Mention the change in behavior. * src/df.c (field_type_t): Add new typedef of 3 enums to distinguish between block, inode and other fields. (field_data_t): Add field_type member of the above new type. (field_data): Add default values for the above field_type, indicating whether a field contains block values, inode values or other, generic values. (field_values_t): Add this struct to store the field values, used by and factored out from get_dev to be able to define such a struct for both the inode and the block values. (get_field_values): Add this function to obtain the block values and the inode values from the file system usage, used by and factored out from get_dev. (add_to_grand_total): Add this function to sum the values of the current mount point up for the grand total, used by and factored out from get_dev. (get_dev): Move the definition of the variables fsu, buf, pct and cell down to where they are used first to give them a better scope. Factor out input_units, output_units, total, available, negate_available, available_to_root, used and negate_used into the above struct field_values_t. Factor out the mapping of the fsu values to the above variables into above function get_field_values. Factor out the summing up of the grand total values into the above function add_to_grand_total. Define block_values and inode_values of the new type and call the new get_field_values to fill them from the fsu values. Call the above function add_to_grand_total for summing up the values for the grand total. Inside the loop over all fields, define a variable 'v' to point to either the block_values or the inode_values, depending on the current field's field_type. Change the code in the cases TOTAL_FIELD/ITOTAL_FIELD, USED_FIELD/IUSED_FIELD, AVAIL_FIELD/ IAVAIL_FIELD and PCENT_FIELD/IPCENT_FIELD to use the field values where 'v' is pointing to, i.e., either the block_values or the inode_values. * src/df.c (main): Remove setting of grand_fsu.fsu_blocks in the inode_format case as this is no longer needed and would lead to wrong results once when mixed block/inode fields will be used. * src/df.c (main): Cleanup the code at the end regarding file_systems_processed to make the code clearer. * src/df.c (inode_format): Remove variable. (main): Remove initialization of the above variable. In getopts loop, directly set the header_mode to INODES_MODE instead of using the above variable. Afterwards, remove the mapping to INODES_MODE as it is already set. * src/df.c (posix_format): Move variable ... (main): ... to here. * src/df.c (print_table): Enhance the comment about 2-line format in cases where the SOURCE_FIELD exceeds 20 chars, as such behavior has been removed long ago by commit v8.10-40-g99679ff. * src/df.c (Display modes): Add OUTPUT_MODE, remove unused NMODES. (display_field_t): Remove unnecessary NFIELDS. (field_data_t): Add member 'arg' for the field name in the --output argument. Add member 'used' to remember if a field is already used in the columns array. (field_data): Add values for the above new members arg and used. (all_args_string): Add variable which represents the argument for the --output option which includes all fields. (OUTPUT_OPTION): Add enum to identify the long --output option. (long_options): Add optional-argument --output option. (alloc_field): Assert that the field is not already used. Mark the field as used. (decode_output_arg): Add function to parse the comma-separated field list passed to the --output option in order to add the appropriate fields to the columns array. (get_field_list): Add case for the new OUTPUT_MODE to add all available fields to columns in the case the --output option has been passed without any values. Use the comma-separated field list form to pass to decode_output_arg to keep the field header mapping for the OUTPUT_MODE only on one place. (main): Define format string msg_mut_excl to be used in the following checks whether the use of --output and the other option is mutually exclusive. In the getopt_long loop, add a check to the case for the -i option to issue an error message when it is used together with --output; Likewise for -T and -P. Add a new case for OUTPUT_OPTION, together with similar checks as above and eventually passing the optarg to decode_output_arg. After the getopt_long loop, consider the OUTPUT_MODE case in order not to run into -h or -P mode. * src/df.c (get_dev): Also xstrdup the dev_name, and free it afterwards to silence a valgrind warning about definitely lost memory. (main): Free the columns store to silence valgrind, guarded by the IF_LINT macro. * src/df.c (main): Pass "total" as the mount point to get_dev if the SOURCE_FIELD is not among the columns to output. * tests/df/df-output.sh: Change the test to ensure the content of the target field of the grand total line: if the source field is present, then the target should be "-", else the target field should be "target". * NEWS (Changes in behavior): Enhance the exiting NEWS entry. * doc/coreutils.texi (df invocation): Document the content of the source and target field in the grand total line. * src/df.c (main): Add another condition to the need_fs_type parameter of read_file_system_list whether the FSTYPE_FIELD is used or not. * src/df.c (get_header): Indicate the block size used, in the "size" header, when using --output without -h. * tests/df/df-output.sh: Adjust for, and add an extra test for, the new behavior.
2012-11-05maint: fix factor's test file name pattern in .gitignoreBernhard Voelker
* .gitignore: Adapt the entry for the files generated during the factor tests (see v8.20-9-g1cace4a).
2012-11-04timeout: add --preserve-status to always propagate the exit statusÁngel González
It's useful for commands that support running for an indeterminite amount of time, to not return a specific timeout exit status (124), and instead let the command handle the timeout signal and return a status for the work done so far. * doc/coreutils.texi (timeout invocation): Describe the new option. * src/timeout.c (preserve_status): A new global boolean to enable the --preserve-status behavior. (usage): Describe the new option. (main): Don't return EXIT_TIMEOUT of preserve_status is set. * tests/misc/timeout.sh: Add a test for the new option.
2012-11-04maint: fix the error message from sc_check-I18N-AUTHORSPádraig Brady
* cfk.mk (sc_check-I18N-AUTHORS): Fix the quoting so you don't get a 'command not found' error.