| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add --update=none which is equivalent to the --no-clobber behavior
from before coreutils 9.2. I.e. existing files are unconditionally
skipped, and them not being replaced does not affect the exit status.
* src/copy.h [enum Update_type]: A new type to support parameters
to the --update command line option.
[enum Interactive]: Add I_ALWAYS_SKIP.
* src/copy.c: Treat I_ALWAYS_SKIP like I_ALWAYS_NO (-n),
except that we don't fail when skipping.
* src/system.h (emit_update_parameters_note): A new function
to output the description of the new --update parameters.
* src/cp.c (main): Parse --update arguments, ensuring that
-n takes precedence if specified.
(usage): Describe the new option. Also allude that
-u is related in the -n description.
* src/mv.c: Accept the new --update parameters and
update usage() accordingly.
* doc/coreutils.texi (cp invocation): Describe the new --update
parameters. Also reference --update from the --no-clobber description.
(mv invocation): Likewise.
* tests/mv/update.sh: Test the new parameters.
* NEWS: Mention the new feature.
Addresses https://bugs.gnu.org/62572
|
|
|
|
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Add free-posix, tmpfile.
* src/split.c (copy_to_tmpfile): New function.
(input_file_size): Use it to split larger files when sizes cannot
easily be determined via fstat or lseek. See Bug#61386#235.
* tests/split/l-chunk.sh: Mark tests of /dev/zero as
very expensive since they exhaust /tmp.
|
|
|
|
|
|
|
|
| |
Problem reported by Christoph Anton Mitterer (Bug#61884).
* src/du.c (process_file): When counting apparent sizes, count
only usable st_size members.
* tests/du/apparent.sh: New file.
* tests/local.mk (all_root_tests): Add it.
|
|
|
|
|
|
|
|
| |
* src/split.c (bytes_split): New arg REM_BYTES.
Use this to split more evenly. All callers changed.
(lines_chunk_split, bytes_chunk_extract):
Be consistent with new byte_split.
* tests/split/b-chunk.sh, tests/split/l-chunk.sh: Test new behavior.
|
|
|
|
|
|
|
|
|
|
| |
* src/tee.c (usage): Change from describing one (non pipe) aspect
to the more general point of being the option to use if working with
pipes, and referencing the more detailed info below.
* doc/coreutils.texi (tee invocation): s/standard/appropriate/ since
the standard operation with pipes is to exit immediately upon write
error. s/early/immediately/ as it's ambiguous as to what "early"
is in relation to.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If input is intermittent (a tty, pipe, or socket), and all remaining
outputs are pipes (eg, >(cmd) process substitutions), exit early when
they have all become broken pipes (and thus future writes will fail),
without waiting for more input to become available, as future write
attempts to these outputs will fail (SIGPIPE/EPIPE).
Only provide this enhancement when pipe errors are ignored (-p mode).
Note that only one output needs to be monitored at a time with iopoll(),
as we only want to exit early if _all_ outputs have been removed.
* src/tee.c (pipe_check): New global for iopoll mode.
(main): enable pipe_check for -p, as long as output_error ignores EPIPE,
and input is suitable for iopoll().
(get_next_out): Helper function for finding next valid output.
(fail_output, tee_files): Break out write failure/output removal logic
to helper function.
(tee_files): Add out_pollable array to track which outputs are suitable
for iopoll() (ie, that are pipes); track first output index that is
still valid; add iopoll() broken pipe detection before calling read(),
removing an output that becomes a broken pipe.
* src/local.mk (src_tee_SOURCES): include src/iopoll.c.
* NEWS: Mention tee -p enhancement in Improvements.
* doc/coreutils.texi: Mention the new early exit behavior in the nopipe
modes for the tee -p option.
Suggested-by: Arsen Arsenović <arsen@aarsen.me>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
How a file is copied is dependent on the sparseness of the file,
what file system it is on, what file system the destination is on,
the attributes of the file, and whether they're being copied or not.
Also the --reflink and --sparse options directly impact the operation.
Given it's hard to reason about the combination of all of the above,
the --debug option is useful for users to directly identify if
copy offloading, reflinking, or sparse detection are being used.
It will also be useful for tests to directly query if
these operations are supported.
The new output looks as follows:
$ src/cp --debug src/cp file.sparse
'src/cp' -> 'file.sparse'
copy offload: yes, reflink: unsupported, sparse detection: no
$ truncate -s+1M file.sparse
$ src/cp --debug file.sparse file.sparse.cp
'file.sparse' -> 'file.sparse.cp'
copy offload: yes, reflink: unsupported, sparse detection: SEEK_HOLE
$ src/cp --reflink=never --debug file.sparse file.sparse.cp
'file.sparse' -> 'file.sparse.cp'
copy offload: avoided, reflink: no, sparse detection: SEEK_HOLE
* doc/coreutils.texi (cp invocation): Describe the --debug option.
(mv invocation): Likewise.
(install invocation): Likewise.
* src/copy.h: Add a new DEBUG member to cp_options, to control
whether to output debug info or not.
* src/copy.c (copy_debug): A new global structure to
unconditionally store debug into from the last copy_reg operations.
(copy_debug_string, emit_debug): New functions to print debug info.
* src/cp.c: if ("--debug") x->debug=true;
* src/install.c: Likewise.
* src/mv.c: Likewise.
* tests/cp/debug.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the new feature.
|
|
|
|
|
|
|
|
|
|
| |
* doc/coreutils.texi: s/functionalty/functionality/,
s/sychronize/synchronize/, s/millsecond/millisecond/
s/paramter/parameters/
* init.cfg: s/parmeters/parameters/
* scripts/build-older-versions/README.older-versions: s/vesion/version/
* tests/misc/env-S-script.sh: s/paramaters/parameters/
Fixes https://bugs.gnu.org/61681
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--raw output is the most composable format, and also is a
robust way to discard the file name without parsing (escaped) output.
Examples:
$ cksum --raw -a crc "$afile" | basenc --base16
4ACFC4F0
$ cksum --raw -a crc "$afile" | basenc --base2msbf
01001010110011111100010011110000
$ cksum --raw -a sha256 "$bfile" | basenc --base32
AAAAAAAADHLGRHAILLQWLAY6SNH7OY5OI2RKNQLSWPY3MCUM4JXQ====
* doc/coreutils.texi (cksum invocation): Describe the new feature.
* src/digest.c (output_file): Inspect the new RAW_DIGEST global,
and output the bytes directly if set.
* src/cksum.c (output_crc): Likewise.
* src/sum.c (output_bsd, output_sysv): Likewise.
* tests/misc/cksum-raw.sh: A new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the new feature.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/digest.c [HASH_ALGO_CKSUM]: Include "base64.h"
[HASH_ALGO_CKSUM] (base64_digest): New global.
[HASH_ALGO_CKSUM] (enum BASE64_DIGEST_OPTION): New enum.
[HASH_ALGO_CKSUM] (long_options): Add "base64".
(valid_digits): Rename from hex_digits, now taking an input length argument.
Adjust callers.
(bsd_split_3): Rename arg from hex_digits to digest.
Add new *d_len parameter for length of extracted digest.
Move "i" declaration down to first use.
(split_3): Rename arg from hex_digits to digest.
Add new *d_len parameter for length of extracted digest.
Instead of relying on "known" length of digest to find the following
must-be-whitespace byte, search for the first whitespace byte.
[HASH_ALGO_CKSUM] (output_file): Handle base64_digest.
[HASH_ALGO_CKSUM] (main): Set base64_digest.
[HASH_ALGO_CKSUM] (b64_equal): New function.
(hex_equal): New function, factored out of digest_check.
(digest_check) Factored part into b64_equal and hex_equal.
Rename local hex_digest to digest.
* tests/misc/cksum-base64.pl: Add tests.
* tests/local.mk (all_tests): Add to the list.
* cfg.mk (_cksum): Define.
(exclude_file_name_regexp--sc_prohibit_test_backticks): Exempt new test.
(exclude_file_name_regexp--sc_long_lines): Likewise.
* doc/coreutils.texi (cksum invocation): Document it.
(md5sum invocation) [--check]: Mention digest encoding auto-detect.
* NEWS (New Features): Mention this.
|
|
|
|
| |
* doc/coreutils.texi: Spruce up cp --preserve=mode doc.
|
|
|
|
|
|
|
|
|
|
| |
This reverts the previous change, so that when a file
is skipped due to -u, this is not considered a failure.
* doc/coreutils.texi: Document this.
* src/copy.c (copy_internal): If --update says to skip,
treat this as success instead of failure.
* tests/mv/update.sh, tests/cp/slink-2-slink.sh:
Revert previous change, to match reverted behavior.
|
|
|
|
|
|
|
|
|
|
|
| |
* NEWS, doc/coreutils.texi: Document this.
* src/copy.c (copy_internal):
* src/ln.c (do_link): Return false when skipping action due to
--interactive or --no-clobber.
* tests/cp/cp-i.sh, tests/cp/preserve-link.sh:
* tests/cp/slink-2-slink.sh, tests/mv/i-1.pl, tests/mv/i-5.sh:
* tests/mv/mv-n.sh, tests/mv/update.sh:
Adjust expectations of exit status to match revised behavior.
|
|
|
|
|
|
|
|
|
|
|
| |
Wishlist item from Mike Frysinger (Bug#61050).
* src/copy.c (copy_internal):
Do not fall back on copying if x->no_copy.
* src/copy.h (struct cp_options): New member no_copy.
* src/mv.c (NO_COPY_OPTION): New constant.
(long_options, usage, main): Support --no-copy.
* tests/mv/no-copy.sh: New test.
* tests/local.mk (all_tests): Add it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/dd.c (parse_integer): Support Q,R suffixes.
* src/od.c (main): Likewise.
* src/split.c (main): Likewise.
* src/stdbuf.c (parse_size): Likewise.
* src/truncate.c (main): Likewise.
* src/sort.c (specify_size_size): Likewise.
Also line length syntax check fix.
* tests/misc/numfmt.pl: Adust top end large number checks
to the new largest values.
* doc/coreutils.texi (numfmt invocation): Add a numfmt example.
* NEWS: Tweak to aid searchability.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/dd, src/head.c, src/od.c, src/sort.c, src/stdbuf.c, src/tail.c:
(usage):
* src/system.h (emit_size_note):
Mention new SI prefixes.
* src/du.c (main):
* src/head.c (head_file):
* src/numfmt.c (suffix_power, suffix_power_char, prepare_padded_number):
* src/shred.c (main):
* src/sort.c (unit_order):
* src/tail.c (parse_options):
Support new SI prefixes.
* src/numfmt.c (MAX_ACCEPTABLE_DIGITS): Increase to 33.
(zero_and_valid_suffixes, valid_suffixes): New constants,
with new SI prefixes.
(valid_suffix, unit_to_umax): Use them.
(prepare_padded_number): Diagnose "999Q" instead of "999Y".
* tests/misc/numfmt.pl, tests/misc/sort.pl:
Adjust tests to match new max.
|
|
|
|
|
|
|
|
|
|
| |
Update to latest gnulib with new copyright year.
Run "make update-copyright" and then...
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Manually update copyright year,
until we fully sync with gnulib at a later stage.
* tests/sample-test: Adjust to use the single most recent year.
|
|
|
|
|
| |
Problem reported by Krzysztof Żelechowski (Bug#60335).
* doc/coreutils.texi (du invocation): Reword.
|
|
|
|
| |
* doc/coreutils.texi (du invocation): Reword.
|
| |
|
|
|
|
|
|
| |
Suggested by Marc Chantreux (bug#59827).
* doc/coreutils.texi (Options for date):
Give formats for -I, like we already do for --rfc-3339.
|
|
|
|
|
|
| |
* doc/coreutils.texi (tee invocation): Give a more
cohesive description of the -p option, and how
it differs from the default operation.
|
|
|
|
|
|
|
|
| |
* doc/coreutils.texi, doc/sort-version.texi: Prefer on "x -- y" to
"x---y" in prose, as the result is more readable in Emacs.
Fix some instances of unescaped ‘-’ that should be minus, not
hyphen. Fix some other instances that should be en dash. No
spaces around en dash when it’s a range.
|
|
|
|
|
|
|
|
| |
* cfg.mk (sc_texi_long_option_escaped): A new check to
avoid future instances of this.
* doc/coreutils.texi (Common options): Rearrange this menu
to be less repetitive in each description, and avoid long lines.
Addresses https://bugs.gnu.org/59262
|
|
|
|
|
|
|
| |
Problem reported by Antonio Diaz Diaz (bug#59262).
* doc/coreutils.texi: Use markup in menus to prevent
‘--’ from turning into an em dash, and to be more
consistent.
|
|
|
|
|
|
|
|
|
|
|
| |
Note using iconv(1) rather than recode(1) is not appropriate
for this example, as the required functionality is only
available on libiconv's iconv implementation, which is
not installed on most systems.
* doc/coreutils.texi (printf invocation): Use env rather than
/usr/local/bin for the printf command. Escape '%' so more robust.
Also use a locale that exists on modern systems.
|
|
|
|
|
| |
* doc/coreutils.texi (printf invocation): Move the description
of accepted options from the middle of the unicode discussion.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously this was restricted to the C99 universal character subset,
which restricted most values <= 0x9F, as that simplifies the C lexer.
However printf(1) doesn't need this restriction.
Note also the bash builtin printf already supports all values <= 0x9F.
* src/printf.c (main): Relax the restriction on points <= 0x9F.
* doc/coreutils.texi (printf invocation): Adjust description.
* tests/misc/printf-cov.pl: Adjust accordingly. Add new cases.
* NEWS: Mention the change in behavior.
Reported at https://bugs.debian.org/1022857
|
|
|
|
|
|
|
|
| |
* doc/coreutils.texi (base32 invocation): Reference basenc
to improve discoverability.
(base64 invocation): Likewise.
* man/base32.x: Likewise.
* man/base64.x: Likewise.
|
|
|
|
|
|
|
| |
* doc/coreutils.texi (sort invocation): Mention in the
multi invocation sort example that the -V GNU extension
could be used to sort IPv4 addresses, and thus simplify
to a single invocation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/system.h (emit_exec_status): A new function to
output standard "Exit status:" info for commands that exec others.
* doc/coreutils.texi (Exit status): Add "ls" and "runcon"
to the list of commands with non standard exit status.
* src/numfmt.c (main): Call initialize_exit_failure() explicitly
to better indicate this utility may exit with something other than
EXIT_FAILURE.
* src/timeout.c (usage): Use more consistent capitalization.
* src/chroot.c: Call emit_exec_status().
* src/env.c: Likewise.
* src/nice.c: Likewise.
* src/nohup.c: Likewise.
* src/runcon.c: Likewise.
* src/stdbuf.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
without this option, control of when the total is output
is quite awkward. Consider trying to suppress the total line,
which could be achieved with something like:
wc-no-total() { wc "$@" /dev/null | head -n-2; }
As well as being non obvious, it's also non general.
It would give a non failure, but zero count if passed a file on stdin.
Also it doesn't work in conjunction with the --files0-from option,
which would need to be handled differently with something like:
{ find files -print0; printf '%s\0' /dev/null; } |
wc --files0-from=- |
head -n2
Also getting just the total can be awkward as file names
are only suppressed when processing stdin, and
also a total line is only printed if processing more than one file.
For completness this might be achieved currently with:
wc-only-total() {
wc "$@" |
tail -n1 |
sed 's/^ *//; s/ [^ 0-9]*$//'
}
* src/wc.c: Add new --total option.
* tests/misc/wc-total.sh: New test suite for the new option.
* tests/local.mk: Reference the new test.
* doc/coreutils.texi (wc invocation): Document the new option.
* THANKS.in: Add suggestor.
* NEWS: Mention the new feature.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* README-hacking:
* README-prereq:
* THANKS.in:
* doc/sort-version.texi (Other version/natural sort implementations):
* gl/lib/rand-isaac.c:
* gl/tests/test-rand-isaac.c:
* src/operand2sig.c (operand2sig):
* src/remove.c (nonexistent_file_errno):
* tests/misc/env-signal-handler.sh:
* tests/misc/sort-debug-warn.sh (LC_ALL): Prefer HTTPS to HTTP.
Addresses https://bugs.gnu.org/56512
Copyright-paperwork-exempt: yes
|
|
|
|
|
|
| |
* doc/coreutils.texi: Fix wording.
Copyright-paperwork-exempt: yes
|
|
|
|
|
|
|
| |
* doc/coreutils.texi (stty invocation): Say that "drain"
is treated as an option, rather than a line setting,
and so option processing rules apply to it.
Reported in https://bugs.debian.org/1018803
|
|
|
|
|
|
|
|
|
|
|
| |
* src/comm.c (compare_files): Handle the single character
--output-delimeter case separately so that NUL is appropriately
handled.
* doc/coreutils.texi (comm invocation): Fix the description
of --output-delimiter to say an empty delimeter is treated
as a NUL separator, rather than being disallowed.
* tests/misc/comm.pl: Add a test case.
Reported at https://bugs.debian.org/1014008
|
|
|
|
|
|
|
|
|
| |
* src/runcon.c: Use EXIT_CANCELED (125) instead of EXIT_FAILURE (1),
so that errors specific to runcon can be distinguished,
from those of the invoked program.
* doc/coreutils.texi (runcon invocation): Fix the Exit status
description to say we return 125 (not 127) for internal errors.
* tests/misc/runcon-no-reorder.sh: Add a test case.
|
|
|
|
|
|
|
|
| |
* src/ls.c [time_args]: Add support for explicit
'mtime' or 'modification' arguments to --time.
* tests/misc/ls-time.sh: Add explicit --time=mtime usage.
* doc/coreutils.texi (ls invocation): Describe --time=mtime.
* NEWS: Mention the new feature.
|
|
|
|
|
|
|
|
|
| |
* src/ls.c (usage): Don't mention "modification" in the
description of ctime (-c), as it's confusing with mtime.
Mention "metadata" when discussing "change" time to
disambiguate from data change time.
* doc/coreutils.texi (ls invocation): State that --time=creation
falls back to using mtime where not available.
|
|
|
|
|
|
|
|
| |
This behaviour is correctly documented when doing `cp --help`.
There is no `--reflink=when` option.
* doc/coreutils.texi (cp invocation): Fix document stating
that `--reflink` is equivalent to `--reflink=always`.
|
|
|
|
|
| |
* doc/coreutils.texi (uniq invocation): State that leading blanks
are part of the field, and also that -f is one based.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's useful to treat empty and missing arguments differently.
Missing means all signals, while empty means no signals and
so is a no-op. It's useful to treat empty arguments like
this, so that dynamically specified arguments like the following
are supported
env --ignore-signals "$SIGS_TO_IGNORE"
Note `env --ignore-signals=` is treated as an empty argument.
* doc/coreutils.texi (env invocation): Empty args are treated
differently to missing arguments, so call that out explicitly.
* src/env.c (usage): Likewise.
Addresses https://bugs.debian.org/1016049
|
|
|
|
|
|
|
|
| |
* src/date.c (usage): Specify that --date, --file, --reference,
and --resolution are mutually exclusive. This is also useful
documentation to group similar options.
* doc/coreutils.texi (Options for date): Likewise.
Addresses https://bugs.gnu.org/55401
|
|
|
|
|
| |
* doc/coreutils.texi (dd invocation): Explain
fdatasync and fsync better.
|
|
|
|
|
| |
* bootstrap: Copy from latest Gnulib.
* tests/misc/ls-misc.pl (v_files): Adjust to new Gnulib behavior.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When factoring numbers that have a large 2^n factor, it can be hard to
eyeball just how many 2's there are. Add an option to print each prime
power factor in the p^e format (omitting the exponent when it is 1).
* src/factor.c: Add -h, --exponents option for printing in p^e format.
* doc/coreutils.texi (factor invocation): Document the new option.
* tests/misc/factor.pl: Add test case.
* THANKS.in: Add previous suggester
(https://lists.gnu.org/r/coreutils/2017-11/msg00015.html).
Suggested-by: Emanuel Landeholm <emanuel.landeholm@gmail.com>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
|
|
|
|
|
|
|
|
|
| |
* doc/coreutils.texi: Set txicodequoteundirected and
txicodequotebacktick so that ' and ` in code examples appear
as-is, rather than being transliterated to ’ and ‘. E.g., prefer
“... this is equivalent to ‘tr '\303\266' '\305\201'’ and ...” to
“... this is equivalent to ‘tr ’\303\266’ ’\305\201’’ and ...”
in PDF output.
|
|
|
|
|
| |
* doc/coreutils.texi: Reword footnote, or put it right next
to previous punctuation.
|