mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
158 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf28242fd5 | ||
|
|
5f47cda3ab | ||
|
|
a971cd4ff7 | ||
|
|
66e2daa689 | ||
|
|
a376de95c3 | ||
|
|
daa46dbe7d | ||
|
|
b918a20234 | ||
|
|
bf2f64c7d5 | ||
|
|
4bb49f04a1 | ||
|
|
16358bc19c | ||
|
|
4bbbe49074 | ||
|
|
efa3e5dda6 | ||
|
|
7c35a36bf4 | ||
|
|
6bf6d7f461 | ||
|
|
95adadd9a4 | ||
|
|
186896d65f | ||
|
|
811493e2a9 | ||
|
|
0d6be4b01f | ||
|
|
4ae1369516 | ||
|
|
a5202bd585 | ||
|
|
2ab2f7a422 | ||
|
|
d5c820109e | ||
|
|
3e7fd6650e | ||
|
|
b1e7af28eb | ||
|
|
c50c4ab9e1 | ||
|
|
44af84263e | ||
|
|
36b99b6113 | ||
|
|
f473489f48 | ||
|
|
b1ac478653 | ||
|
|
5e1a554712 | ||
|
|
636cbdb77b | ||
|
|
620112526b | ||
|
|
2193e0b9fb | ||
|
|
03fbb5ecec | ||
|
|
027eeec7b0 | ||
|
|
2e8f885a2a | ||
|
|
90933c8eb0 | ||
|
|
001897e7e2 | ||
|
|
ca80339454 | ||
|
|
8adc7ccf7c | ||
|
|
eb73e23f31 | ||
|
|
3fe8bc09be | ||
|
|
3cd48057c7 | ||
|
|
643a7325ec | ||
|
|
fa50623394 | ||
|
|
17983b2cb3 | ||
|
|
d26dece5d8 | ||
|
|
94fa0aa0d0 | ||
|
|
f114495e3e | ||
|
|
39ca7731e2 | ||
|
|
d5ab4cbe42 | ||
|
|
d045ce5166 | ||
|
|
daaae12e3b | ||
|
|
8dfcf38af1 | ||
|
|
1f9152a50f | ||
|
|
67c537b91c | ||
|
|
d1de5857c7 | ||
|
|
2f438fa9f5 | ||
|
|
21c59d6845 | ||
|
|
69df9e20e2 | ||
|
|
a6756257ef | ||
|
|
4711c49312 | ||
|
|
94d364f157 | ||
|
|
806b0d1580 | ||
|
|
d9a4d98371 | ||
|
|
bdd54b4ee0 | ||
|
|
8d328706c6 | ||
|
|
1a674a036b | ||
|
|
7fd7709a7a | ||
|
|
88c32fa68e | ||
|
|
6bc89f5f85 | ||
|
|
8ea92f2a1d | ||
|
|
571f63f501 | ||
|
|
cbc427485e | ||
|
|
9c3730e601 | ||
|
|
4d5db7193c | ||
|
|
dedb3973e3 | ||
|
|
a32a756a58 | ||
|
|
7262994810 | ||
|
|
f7b2502100 | ||
|
|
e5dae2c6b0 | ||
|
|
25c74a37ca | ||
|
|
1ecf7abe4a | ||
|
|
437555061c | ||
|
|
46d6bd0c0a | ||
|
|
49b682bdd8 | ||
|
|
4397410532 | ||
|
|
351ac1256b | ||
|
|
19ceb7b89e | ||
|
|
83322567de | ||
|
|
53793cd35f | ||
|
|
89f7fcd055 | ||
|
|
3246bc08a6 | ||
|
|
68cf7ad5ad | ||
|
|
1755ffb7b6 | ||
|
|
a68efd1283 | ||
|
|
4b7595d751 | ||
|
|
d542945c3a | ||
|
|
6d6095f33a | ||
|
|
91d78a570f | ||
|
|
3e5dcddba7 | ||
|
|
2ed7c28679 | ||
|
|
932ec637a6 | ||
|
|
da07736952 | ||
|
|
07df260421 | ||
|
|
5fb8eb091f | ||
|
|
cb1f253e63 | ||
|
|
ac7bd90cee | ||
|
|
c932e5c9ec | ||
|
|
163df41d45 | ||
|
|
668306ed86 | ||
|
|
a0118a71bb | ||
|
|
068b46e73b | ||
|
|
24053fbd8f | ||
|
|
c744c65f50 | ||
|
|
77517a9917 | ||
|
|
21682faa5e | ||
|
|
de73c801f3 | ||
|
|
5e7b8928b7 | ||
|
|
c8eb21c9c0 | ||
|
|
fb1ca34140 | ||
|
|
c732388fa1 | ||
|
|
d3daa95096 | ||
|
|
a391007511 | ||
|
|
694d10b71e | ||
|
|
a5d158ab8f | ||
|
|
f6cb50cc99 | ||
|
|
ea7ae28b10 | ||
|
|
3299901cde | ||
|
|
9781fcd532 | ||
|
|
e0566c5fea | ||
|
|
ad9b283247 | ||
|
|
22424dde74 | ||
|
|
3968f28dfd | ||
|
|
e6017741e9 | ||
|
|
a8a52e2f05 | ||
|
|
d1a754c827 | ||
|
|
30e91a10ea | ||
|
|
8d6acfd853 | ||
|
|
49b126bfc5 | ||
|
|
5ed2018360 | ||
|
|
0753c3f6dc | ||
|
|
b1fa4aa63c | ||
|
|
2eaf3a14a5 | ||
|
|
1f52607fc3 | ||
|
|
0a85449dde | ||
|
|
33f17ab9db | ||
|
|
4bc50727f0 | ||
|
|
bedd9bb652 | ||
|
|
29baf25aa0 | ||
|
|
bc2fd97964 | ||
|
|
b88f8d1101 | ||
|
|
7e244891b0 | ||
|
|
3f9b1b86b1 | ||
|
|
7597cfa482 | ||
|
|
bd4dd61a17 | ||
|
|
ece7157933 | ||
|
|
1d7db19cba |
4
.github/ISSUE_TEMPLATE.txt
vendored
4
.github/ISSUE_TEMPLATE.txt
vendored
@@ -28,7 +28,7 @@ Before reporting a new bug, please check the following resources:
|
||||
https://lists.gnu.org/archive/html/bug-coreutils/
|
||||
|
||||
* Open Bugs:
|
||||
https://debbugs.gnu.org/cgi/pkgreport.cgi?which=pkg&data=coreitils
|
||||
https://debbugs.gnu.org/cgi/pkgreport.cgi?which=pkg&data=coreutils
|
||||
|
||||
* Translation related issues:
|
||||
https://translationproject.org/domain/coreutils.html
|
||||
@@ -68,7 +68,7 @@ When sending messages to coreutils@gnu.org or bug-coreutils@gnu.org :
|
||||
|
||||
|
||||
<!--
|
||||
Copyright (C) 2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
4
.github/PULL_REQUEST_TEMPLATE.txt
vendored
4
.github/PULL_REQUEST_TEMPLATE.txt
vendored
@@ -36,7 +36,7 @@ contributing to the GNU Project, please read
|
||||
* Bug reports Mailing List:
|
||||
https://lists.gnu.org/archive/html/bug-coreutils/
|
||||
|
||||
* Open Bugs: https://debbugs.gnu.org/cgi/pkgreport.cgi?which=pkg&data=coreitils
|
||||
* Open Bugs: https://debbugs.gnu.org/cgi/pkgreport.cgi?which=pkg&data=coreutils
|
||||
|
||||
* Translation related issues:
|
||||
https://translationproject.org/domain/coreutils.html
|
||||
@@ -88,7 +88,7 @@ in this matter.
|
||||
|
||||
|
||||
<!--
|
||||
Copyright (C) 2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -45,7 +45,10 @@
|
||||
/lib/.dirstamp
|
||||
/lib/.gitignore
|
||||
/lib/alloca.h
|
||||
/lib/arg-nonnull.h
|
||||
/lib/arpa/inet.h
|
||||
/lib/byteswap.h
|
||||
/lib/c++defs.h
|
||||
/lib/charset.alias
|
||||
/lib/config.h
|
||||
/lib/config.hin
|
||||
@@ -104,7 +107,9 @@
|
||||
/lib/unitypes.h
|
||||
/lib/uniwidth
|
||||
/lib/uniwidth.h
|
||||
/lib/unused-parameter.h
|
||||
/lib/utime.h
|
||||
/lib/warn-on-use.h
|
||||
/lib/wchar.h
|
||||
/lib/wctype.h
|
||||
/m4/.cvsignore
|
||||
@@ -170,6 +175,9 @@
|
||||
/src/coreutils_shebangs
|
||||
/src/cu-progs.mk
|
||||
/src/fs-latest-magic.h
|
||||
/src/fs-def
|
||||
/src/fs-kernel-magic
|
||||
/src/fs-magic
|
||||
/src/libsinglebin_*.a
|
||||
/src/make-prime-list
|
||||
/src/primes.h
|
||||
|
||||
@@ -1 +1 @@
|
||||
8.28
|
||||
8.30
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Suppress valgrind diagnostics we don't care about.
|
||||
|
||||
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
3
AUTHORS
3
AUTHORS
@@ -6,6 +6,7 @@ b2sum: Padraig Brady, Samuel Neves
|
||||
base32: Simon Josefsson
|
||||
base64: Simon Josefsson
|
||||
basename: David MacKenzie
|
||||
basenc: Simon Josefsson, Assaf Gordon
|
||||
cat: Torbjorn Granlund, Richard M. Stallman
|
||||
chcon: Russell Coker, Jim Meyering
|
||||
chgrp: David MacKenzie, Jim Meyering
|
||||
@@ -26,7 +27,7 @@ dircolors: H. Peter Anvin
|
||||
dirname: David MacKenzie, Jim Meyering
|
||||
du: Torbjorn Granlund, David MacKenzie, Paul Eggert, Jim Meyering
|
||||
echo: Brian Fox, Chet Ramey
|
||||
env: Richard Mlynarik, David MacKenzie
|
||||
env: Richard Mlynarik, David MacKenzie, Assaf Gordon
|
||||
expand: David MacKenzie
|
||||
expr: Mike Parker, James Youngman, Paul Eggert
|
||||
factor: Paul Rubin, Torbjörn Granlund, Niels Möller
|
||||
|
||||
2
HACKING
2
HACKING
@@ -617,7 +617,7 @@ and root only tests, is to follow these steps (requires lcov to be installed):
|
||||
xdg-open doc/coverage/index.html
|
||||
|
||||
========================================================================
|
||||
Copyright (C) 2009-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2009-2019 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Make coreutils. -*-Makefile-*-
|
||||
|
||||
# Copyright (C) 1990-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1990-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -93,7 +93,7 @@ dist-hook: gen-ChangeLog
|
||||
$(AM_V_at)touch $(distdir)/doc/constants.texi \
|
||||
$(distdir)/doc/coreutils.info
|
||||
|
||||
gen_start_ver = 8.20
|
||||
gen_start_ver = 8.22
|
||||
.PHONY: gen-ChangeLog
|
||||
gen-ChangeLog:
|
||||
$(AM_V_GEN)if test -d .git; then \
|
||||
|
||||
203
NEWS
203
NEWS
@@ -1,5 +1,192 @@
|
||||
GNU coreutils NEWS -*- outline -*-
|
||||
|
||||
* Noteworthy changes in release 8.31 (2019-03-10) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
'base64 a b' now correctly diagnoses 'b' as the extra operand, not 'a'.
|
||||
[bug introduced in coreutils-5.3.0]
|
||||
|
||||
When B already exists, 'cp -il A B' no longer immediately fails
|
||||
after asking the user whether to proceed.
|
||||
[This bug was present in "the beginning".]
|
||||
|
||||
df no longer corrupts displayed multibyte characters on macOS.
|
||||
[bug introduced with coreutils-8.18]
|
||||
|
||||
seq no longer outputs inconsistent decimal point characters
|
||||
for the last number, when locales are misconfigured.
|
||||
[bug introduced in coreutils-7.0]
|
||||
|
||||
shred, sort, and split no longer falsely report ftruncate errors
|
||||
when outputting to less-common file types. For example, the shell
|
||||
command 'sort /dev/null -o /dev/stdout | cat' no longer fails with
|
||||
an "error truncating" diagnostic.
|
||||
[bug was introduced with coreutils-8.18 for sort and split, and
|
||||
(for shared memory objects only) with fileutils-4.1 for shred]
|
||||
|
||||
sync no longer fails for write-only file arguments.
|
||||
[bug introduced with argument support to sync in coreutils-8.24]
|
||||
|
||||
'tail -f file | filter' no longer exits immediately on AIX.
|
||||
[bug introduced in coreutils-8.28]
|
||||
|
||||
'tail -f file | filter' no longer goes into an infinite loop
|
||||
if filter exits and SIGPIPE is ignored.
|
||||
[bug introduced in coreutils-8.28]
|
||||
|
||||
** Changes in behavior
|
||||
|
||||
cksum, dd, hostid, hostname, link, logname, sleep, tsort, unlink,
|
||||
uptime, users, whoami, yes: now always process --help and --version options,
|
||||
regardless of any other arguments present before any optional '--'
|
||||
end-of-options marker.
|
||||
|
||||
nohup now processes --help and --version as first options even if other
|
||||
parameters follow.
|
||||
|
||||
'yes a -- b' now outputs 'a b' instead of including the end-of-options
|
||||
marker as before: 'a -- b'.
|
||||
|
||||
echo now always processes backslash escapes when the POSIXLY_CORRECT
|
||||
environment variable is set.
|
||||
|
||||
When possible 'ln A B' now merely links A to B and reports an error
|
||||
if this fails, instead of statting A and B before linking. This
|
||||
uses fewer system calls and avoids some races. The old statting
|
||||
approach is still used in situations where hard links to directories
|
||||
are allowed (e.g., NetBSD when superuser).
|
||||
|
||||
ls --group-directories-first will also group symlinks to directories.
|
||||
|
||||
'test -a FILE' is not supported anymore. Long ago, there were concerns about
|
||||
the high probability of humans confusing the -a primary with the -a binary
|
||||
operator, so POSIX changed this to 'test -e FILE'. Scripts using it were
|
||||
already broken and non-portable; the -a unary operator was never documented.
|
||||
|
||||
wc now treats non breaking space characters as word delimiters
|
||||
unless the POSIXLY_CORRECT environment variable is set.
|
||||
|
||||
** New features
|
||||
|
||||
id now supports specifying multiple users.
|
||||
|
||||
'date' now supports the '+' conversion specification flag,
|
||||
introduced in POSIX.1-2017.
|
||||
|
||||
printf, seq, sleep, tail, and timeout now accept floating point
|
||||
numbers in either the current or the C locale. For example, if the
|
||||
current locale's decimal point is ',', 'sleep 0,1' and 'sleep 0.1'
|
||||
now mean the same thing. Previously, these commands accepted only
|
||||
C-locale syntax with '.' as the decimal point. The new behavior is
|
||||
more compatible with other implementations in non-C locales.
|
||||
|
||||
test now supports the '-N FILE' unary operator (like e.g. bash) to check
|
||||
whether FILE exists and has been modified since it was last read.
|
||||
|
||||
env now supports '--default-signal[=SIG]', '--ignore-signal[=SIG]', and
|
||||
'--block-signal[=SIG], to setup signal handling before executing a program.
|
||||
|
||||
env now supports '--list-signal-handling' to indicate non-default
|
||||
signal handling before executing a program.
|
||||
|
||||
** New commands
|
||||
|
||||
basenc is added to complement existing base64,base32 commands,
|
||||
and encodes and decodes printable text using various common encodings:
|
||||
base64,base64url,base32,base32hex,base16,base2,z85.
|
||||
|
||||
** Improvements
|
||||
|
||||
ls -l now better aligns abbreviated months containing digits,
|
||||
which is common in Asian locales.
|
||||
|
||||
stat and tail now know about the "sdcardfs" file system on Android.
|
||||
stat -f -c%T now reports the file system type, and tail -f uses inotify.
|
||||
|
||||
stat now prints file creation time when supported by the file system,
|
||||
on GNU Linux systems with glibc >= 2.28 and kernel >= 4.11.
|
||||
|
||||
|
||||
* Noteworthy changes in release 8.30 (2018-07-01) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
'cp --symlink SRC DST' will again correctly validate DST.
|
||||
If DST is a regular file and SRC is a symlink to DST,
|
||||
then cp will no longer allow that operation to clobber DST.
|
||||
Also with -d, if DST is a symlink, then it can always be replaced,
|
||||
even if it points to SRC on a separate device.
|
||||
[bugs introduced with coreutils-8.27]
|
||||
|
||||
'cp -n -u' and 'mv -n -u' now consistently ignore the -u option.
|
||||
Previously, this option combination suffered from race conditions
|
||||
that caused -u to sometimes override -n.
|
||||
[bug introduced with coreutils-7.1]
|
||||
|
||||
'cp -a --no-preserve=mode' now sets appropriate default permissions
|
||||
for non regular files like fifos and character device nodes etc.,
|
||||
and leaves mode bits of existing files unchanged.
|
||||
Previously it would have set executable bits on created special files,
|
||||
and set mode bits for existing files as if they had been created.
|
||||
[bug introduced with coreutils-8.20]
|
||||
|
||||
'cp --remove-destination file symlink' now removes the symlink
|
||||
even if it can't be traversed.
|
||||
[bug introduced with --remove-destination in fileutils-4.1.1]
|
||||
|
||||
ls no longer truncates the abbreviated month names that have a
|
||||
display width between 6 and 12 inclusive. Previously this would have
|
||||
output ambiguous months for Arabic or Catalan locales.
|
||||
|
||||
'ls -aA' is now equivalent to 'ls -A', since -A now overrides -a.
|
||||
[bug introduced in coreutils-5.3.0]
|
||||
|
||||
'mv -n A B' no longer suffers from a race condition that can
|
||||
overwrite a simultaneously-created B. This bug fix requires
|
||||
platform support for the renameat2 or renameatx_np syscalls, found
|
||||
in recent Linux and macOS kernels. As a side effect, ‘mv -n A A’
|
||||
now silently does nothing if A exists.
|
||||
[bug introduced with coreutils-7.1]
|
||||
|
||||
** Changes in behavior
|
||||
|
||||
'cp --force file symlink' now removes the symlink even if
|
||||
it is self referential.
|
||||
|
||||
ls --color now matches file extensions case insensitively.
|
||||
|
||||
** New features
|
||||
|
||||
cp --reflink now supports --reflink=never to enforce a standard copy.
|
||||
|
||||
env supports a new -v/--debug option to show verbose information about
|
||||
each processing step.
|
||||
|
||||
env supports a new -S/--split-string=S option to split a single argument
|
||||
string into multiple arguments. Used to pass multiple arguments in scripts
|
||||
(shebang lines).
|
||||
|
||||
md5sum accepts a new option: --zero (-z) to delimit the output lines with a
|
||||
NUL instead of a newline character. This also disables file name escaping.
|
||||
This also applies to sha*sum and b2sum.
|
||||
|
||||
rm --preserve-root now supports the --preserve-root=all option to
|
||||
reject any command line argument that is mounted to a separate file system.
|
||||
|
||||
** Improvements
|
||||
|
||||
cut supports line lengths up to the max file size on 32 bit systems.
|
||||
Previously only offsets up to SIZE_MAX-1 were supported.
|
||||
|
||||
stat and tail now know about the "exfs" file system, which is a
|
||||
version of XFS. stat -f --format=%T now reports the file system type,
|
||||
and tail -f uses inotify.
|
||||
|
||||
wc avoids redundant processing of ASCII text in multibyte locales,
|
||||
which is especially significant on macOS.
|
||||
|
||||
|
||||
* Noteworthy changes in release 8.29 (2017-12-27) [stable]
|
||||
|
||||
** Bug fixes
|
||||
@@ -152,6 +339,13 @@ GNU coreutils NEWS -*- outline -*-
|
||||
|
||||
expr supports multibyte strings for all string operations.
|
||||
|
||||
** Changes in behavior
|
||||
|
||||
tail -f now exits immediately if the output is piped and the reader of
|
||||
the pipe terminates. That allows `tail -f file | grep -q foo` to return
|
||||
responsively, but does make `tail -f file | :` exit immediately without
|
||||
waiting for data. Instead one should now `tail -f file | grep -q .`
|
||||
|
||||
** Improvements
|
||||
|
||||
mv --verbose now distinguishes rename and copy operations.
|
||||
@@ -159,9 +353,6 @@ GNU coreutils NEWS -*- outline -*-
|
||||
stat -f -c %l, used to output the max file name length on a file system,
|
||||
is now supported on FreeBSD and OpenBSD.
|
||||
|
||||
tail -f now exits immediately if the output is piped
|
||||
and the reader of the pipe terminates.
|
||||
|
||||
tail -f no longer erroneously warns about being ineffective
|
||||
when following a single tty, as the simple blocking loop used
|
||||
is effective in this case.
|
||||
@@ -1743,7 +1934,9 @@ GNU coreutils NEWS -*- outline -*-
|
||||
|
||||
** New features
|
||||
|
||||
split accepts the --number option to generate a specific number of files.
|
||||
split accepts the --number/-n option to generate a specific number of
|
||||
files, as well as the --elide-empty-files/-e and --unbuffered/-u
|
||||
options to fine-tune the resulting output.
|
||||
|
||||
|
||||
* Noteworthy changes in release 8.7 (2010-11-13) [stable]
|
||||
@@ -4849,7 +5042,7 @@ packages, see ./old/*/NEWS.
|
||||
|
||||
========================================================================
|
||||
|
||||
Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001-2019 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
|
||||
20
README
20
README
@@ -7,15 +7,15 @@ arbitrary limits.
|
||||
|
||||
The programs that can be built with this package are:
|
||||
|
||||
[ arch b2sum base32 base64 basename cat chcon chgrp chmod chown chroot cksum
|
||||
comm coreutils cp csplit cut date dd df dir dircolors dirname du echo env
|
||||
expand expr factor false fmt fold groups head hostid hostname id install
|
||||
join kill link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl
|
||||
nohup nproc numfmt od paste pathchk pinky pr printenv printf ptx pwd
|
||||
readlink realpath rm rmdir runcon seq sha1sum sha224sum sha256sum sha384sum
|
||||
sha512sum shred shuf sleep sort split stat stdbuf stty sum sync tac tail
|
||||
tee test timeout touch tr true truncate tsort tty uname unexpand uniq
|
||||
unlink uptime users vdir wc who whoami yes
|
||||
[ arch b2sum base32 base64 basename basenc cat chcon chgrp chmod chown
|
||||
chroot cksum comm coreutils cp csplit cut date dd df dir dircolors dirname
|
||||
du echo env expand expr factor false fmt fold groups head hostid hostname
|
||||
id install join kill link ln logname ls md5sum mkdir mkfifo mknod mktemp
|
||||
mv nice nl nohup nproc numfmt od paste pathchk pinky pr printenv printf ptx
|
||||
pwd readlink realpath rm rmdir runcon seq sha1sum sha224sum sha256sum
|
||||
sha384sum sha512sum shred shuf sleep sort split stat stdbuf stty sum sync
|
||||
tac tail tee test timeout touch tr true truncate tsort tty uname unexpand
|
||||
uniq unlink uptime users vdir wc who whoami yes
|
||||
|
||||
See the file NEWS for a list of major changes in the current release.
|
||||
|
||||
@@ -232,7 +232,7 @@ the address on the last line of --help output.
|
||||
|
||||
========================================================================
|
||||
|
||||
Copyright (C) 1998-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-2019 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
|
||||
@@ -93,7 +93,7 @@ each program. One way to do this is to use vc-dwim
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#! /bin/bash
|
||||
# Convert this package for use with valgrind.
|
||||
|
||||
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -261,6 +261,7 @@ Ian Kent ikent@redhat.com
|
||||
Ian Lance Taylor ian@cygnus.com
|
||||
Ian Turner vectro@pipeline.com
|
||||
Iida Yosiaki iida@gnu.org
|
||||
Illia Bobyr ibobyr@google.com
|
||||
Ilya N. Golubev gin@mo.msk.ru
|
||||
Ingo Saitz ingo@debian.org
|
||||
Ivan Labath labath3@st.fmph.uniba.sk
|
||||
@@ -285,6 +286,7 @@ Jan-Pawel Wrozstinski jpwroz@gmail.com
|
||||
Jari Aalto jari.aalto@cante.net
|
||||
Jarkko Hietaniemi jhi@epsilon.hut.fi
|
||||
Jarod Wilson jwilson@redhat.com
|
||||
Jason Smith jasonmsmith@google.com
|
||||
Jean Charles Delepine delepine@u-picardie.fr
|
||||
Jean-Pierre Tosoni jpt.7196@gmail.com
|
||||
Jeff Moore jbm@mordor.com
|
||||
@@ -348,7 +350,7 @@ Karsten Thygesen karthy@kom.auc.dk
|
||||
Kaveh R. Ghazi ghazi@caip.rutgers.edu
|
||||
Keith M. Briggs keith.briggs@bt.com
|
||||
Keith Owens kaos@audio.apana.org.au
|
||||
Keith Thompson kst@cts.com
|
||||
Keith Thompson Keith.S.Thompson@gmail.com
|
||||
Ken Irving ken.irving@alaska.edu
|
||||
Ken Pizzini kenp@halcyon.com
|
||||
Kevin Mudrick kmudrick@healthmarketscience.com
|
||||
|
||||
2
TODO
2
TODO
@@ -143,7 +143,7 @@ pr's use of nstrftime can make it malloc a very large (up to SIZE_MAX) buffer
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
297
bootstrap
297
bootstrap
@@ -1,10 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Print a version string.
|
||||
scriptversion=2017-09-19.08; # UTC
|
||||
scriptversion=2019-01-04.17; # UTC
|
||||
|
||||
# Bootstrap this package from checked-out sources.
|
||||
|
||||
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -47,6 +47,8 @@ PERL="${PERL-perl}"
|
||||
|
||||
me=$0
|
||||
|
||||
default_gnulib_url=git://git.sv.gnu.org/gnulib
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $me [OPTION]...
|
||||
@@ -76,6 +78,37 @@ contents are read as shell variables to configure the bootstrap.
|
||||
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
|
||||
are honored.
|
||||
|
||||
Gnulib sources can be fetched in various ways:
|
||||
|
||||
* If this package is in a git repository with a 'gnulib' submodule
|
||||
configured, then that submodule is initialized and updated and sources
|
||||
are fetched from there. If \$GNULIB_SRCDIR is set (directly or via
|
||||
--gnulib-srcdir) and is a git repository, then it is used as a reference.
|
||||
|
||||
* Otherwise, if \$GNULIB_SRCDIR is set (directly or via --gnulib-srcdir),
|
||||
then sources are fetched from that local directory. If it is a git
|
||||
repository and \$GNULIB_REVISION is set, then that revision is checked
|
||||
out.
|
||||
|
||||
* Otherwise, if this package is in a git repository with a 'gnulib'
|
||||
submodule configured, then that submodule is initialized and updated and
|
||||
sources are fetched from there.
|
||||
|
||||
* Otherwise, if the 'gnulib' directory does not exist, Gnulib sources are
|
||||
cloned into that directory using git from \$GNULIB_URL, defaulting to
|
||||
$default_gnulib_url.
|
||||
If \$GNULIB_REVISION is set, then that revision is checked out.
|
||||
|
||||
* Otherwise, the existing Gnulib sources in the 'gnulib' directory are
|
||||
used. If it is a git repository and \$GNULIB_REVISION is set, then that
|
||||
revision is checked out.
|
||||
|
||||
If you maintain a package and want to pin a particular revision of the
|
||||
Gnulib sources that has been tested with your package, then there are two
|
||||
possible approaches: either configure a 'gnulib' submodule with the
|
||||
appropriate revision, or set \$GNULIB_REVISION (and if necessary
|
||||
\$GNULIB_URL) in $me.conf.
|
||||
|
||||
Running without arguments will suffice in most cases.
|
||||
EOF
|
||||
}
|
||||
@@ -129,18 +162,11 @@ bootstrap_post_import_hook() { :; }
|
||||
# Override it via your own definition in bootstrap.conf.
|
||||
bootstrap_epilogue() { :; }
|
||||
|
||||
# The command to download all .po files for a specified domain into
|
||||
# a specified directory. Fill in the first %s is the domain name, and
|
||||
# the second with the destination directory. Use rsync's -L and -r
|
||||
# options because the latest/%s directory and the .po files within are
|
||||
# all symlinks.
|
||||
# The command to download all .po files for a specified domain into a
|
||||
# specified directory. Fill in the first %s with the destination
|
||||
# directory and the second with the domain name.
|
||||
po_download_command_format=\
|
||||
"rsync --delete --exclude '*.s1' -Lrtvz \
|
||||
'translationproject.org::tp/latest/%s/' '%s'"
|
||||
|
||||
# Fallback for downloading .po files (if rsync fails).
|
||||
po_download_command_format2=\
|
||||
"wget --mirror -nd -q -np -A.po -P '%s' \
|
||||
"wget --mirror --level=1 -nd -q -A.po -P '%s' \
|
||||
https://translationproject.org/latest/%s/"
|
||||
|
||||
# Prefer a non-empty tarname (4th argument of AC_INIT if given), else
|
||||
@@ -170,7 +196,15 @@ source_base=lib
|
||||
m4_base=m4
|
||||
doc_base=doc
|
||||
tests_base=tests
|
||||
gnulib_extra_files=''
|
||||
gnulib_extra_files="
|
||||
build-aux/install-sh
|
||||
build-aux/mdate-sh
|
||||
build-aux/texinfo.tex
|
||||
build-aux/depcomp
|
||||
build-aux/config.guess
|
||||
build-aux/config.sub
|
||||
doc/INSTALL
|
||||
"
|
||||
|
||||
# Additional gnulib-tool options to use. Use "\newline" to break lines.
|
||||
gnulib_tool_option_extras=
|
||||
@@ -264,24 +298,18 @@ case "$0" in
|
||||
*) test -r "$0.conf" && . ./"$0.conf" ;;
|
||||
esac
|
||||
|
||||
# Extra files from gnulib, which override files from other sources.
|
||||
test -z "${gnulib_extra_files}" && \
|
||||
gnulib_extra_files="
|
||||
build-aux/install-sh
|
||||
build-aux/mdate-sh
|
||||
build-aux/texinfo.tex
|
||||
build-aux/depcomp
|
||||
build-aux/config.guess
|
||||
build-aux/config.sub
|
||||
doc/INSTALL
|
||||
"
|
||||
|
||||
if test "$vc_ignore" = auto; then
|
||||
vc_ignore=
|
||||
test -d .git && vc_ignore=.gitignore
|
||||
test -d CVS && vc_ignore="$vc_ignore .cvsignore"
|
||||
fi
|
||||
|
||||
if test x"$gnulib_modules$gnulib_files$gnulib_extra_files" = x; then
|
||||
use_gnulib=false
|
||||
else
|
||||
use_gnulib=true
|
||||
fi
|
||||
|
||||
# Translate configuration into internal form.
|
||||
|
||||
# Parse options.
|
||||
@@ -612,95 +640,101 @@ git_modules_config () {
|
||||
test -f .gitmodules && git config --file .gitmodules "$@"
|
||||
}
|
||||
|
||||
if $use_git; then
|
||||
gnulib_path=$(git_modules_config submodule.gnulib.path)
|
||||
test -z "$gnulib_path" && gnulib_path=gnulib
|
||||
fi
|
||||
|
||||
# Get gnulib files. Populate $GNULIB_SRCDIR, possibly updating a
|
||||
# submodule, for use in the rest of the script.
|
||||
|
||||
case ${GNULIB_SRCDIR--} in
|
||||
-)
|
||||
# Note that $use_git is necessarily true in this case.
|
||||
if git_modules_config submodule.gnulib.url >/dev/null; then
|
||||
echo "$0: getting gnulib files..."
|
||||
git submodule init -- "$gnulib_path" || exit $?
|
||||
git submodule update -- "$gnulib_path" || exit $?
|
||||
|
||||
elif [ ! -d "$gnulib_path" ]; then
|
||||
echo "$0: getting gnulib files..."
|
||||
|
||||
trap cleanup_gnulib 1 2 13 15
|
||||
|
||||
shallow=
|
||||
git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
|
||||
git clone $shallow git://git.sv.gnu.org/gnulib "$gnulib_path" ||
|
||||
cleanup_gnulib
|
||||
|
||||
trap - 1 2 13 15
|
||||
if $use_gnulib; then
|
||||
if $use_git; then
|
||||
gnulib_path=$(git_modules_config submodule.gnulib.path)
|
||||
test -z "$gnulib_path" && gnulib_path=gnulib
|
||||
fi
|
||||
GNULIB_SRCDIR=$gnulib_path
|
||||
;;
|
||||
*)
|
||||
# Use GNULIB_SRCDIR directly or as a reference.
|
||||
if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
|
||||
git_modules_config submodule.gnulib.url >/dev/null; then
|
||||
echo "$0: getting gnulib files..."
|
||||
if git submodule -h|grep -- --reference > /dev/null; then
|
||||
# Prefer the one-liner available in git 1.6.4 or newer.
|
||||
git submodule update --init --reference "$GNULIB_SRCDIR" \
|
||||
"$gnulib_path" || exit $?
|
||||
else
|
||||
# This fallback allows at least git 1.5.5.
|
||||
if test -f "$gnulib_path"/gnulib-tool; then
|
||||
# Since file already exists, assume submodule init already complete.
|
||||
git submodule update -- "$gnulib_path" || exit $?
|
||||
else
|
||||
# Older git can't clone into an empty directory.
|
||||
rmdir "$gnulib_path" 2>/dev/null
|
||||
git clone --reference "$GNULIB_SRCDIR" \
|
||||
"$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
|
||||
&& git submodule init -- "$gnulib_path" \
|
||||
&& git submodule update -- "$gnulib_path" \
|
||||
|| exit $?
|
||||
|
||||
# Get gnulib files. Populate $GNULIB_SRCDIR, possibly updating a
|
||||
# submodule, for use in the rest of the script.
|
||||
|
||||
case ${GNULIB_SRCDIR--} in
|
||||
-)
|
||||
# Note that $use_git is necessarily true in this case.
|
||||
if git_modules_config submodule.gnulib.url >/dev/null; then
|
||||
echo "$0: getting gnulib files..."
|
||||
git submodule init -- "$gnulib_path" || exit $?
|
||||
git submodule update -- "$gnulib_path" || exit $?
|
||||
|
||||
elif [ ! -d "$gnulib_path" ]; then
|
||||
echo "$0: getting gnulib files..."
|
||||
|
||||
trap cleanup_gnulib 1 2 13 15
|
||||
|
||||
shallow=
|
||||
if test -z "$GNULIB_REVISION"; then
|
||||
git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
|
||||
fi
|
||||
git clone $shallow ${GNULIB_URL:-$default_gnulib_url} "$gnulib_path" \
|
||||
|| cleanup_gnulib
|
||||
|
||||
trap - 1 2 13 15
|
||||
fi
|
||||
GNULIB_SRCDIR=$gnulib_path
|
||||
;;
|
||||
*)
|
||||
# Use GNULIB_SRCDIR directly or as a reference.
|
||||
if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
|
||||
git_modules_config submodule.gnulib.url >/dev/null; then
|
||||
echo "$0: getting gnulib files..."
|
||||
if git submodule -h|grep -- --reference > /dev/null; then
|
||||
# Prefer the one-liner available in git 1.6.4 or newer.
|
||||
git submodule update --init --reference "$GNULIB_SRCDIR" \
|
||||
"$gnulib_path" || exit $?
|
||||
else
|
||||
# This fallback allows at least git 1.5.5.
|
||||
if test -f "$gnulib_path"/gnulib-tool; then
|
||||
# Since file already exists, assume submodule init already complete.
|
||||
git submodule update -- "$gnulib_path" || exit $?
|
||||
else
|
||||
# Older git can't clone into an empty directory.
|
||||
rmdir "$gnulib_path" 2>/dev/null
|
||||
git clone --reference "$GNULIB_SRCDIR" \
|
||||
"$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
|
||||
&& git submodule init -- "$gnulib_path" \
|
||||
&& git submodule update -- "$gnulib_path" \
|
||||
|| exit $?
|
||||
fi
|
||||
fi
|
||||
GNULIB_SRCDIR=$gnulib_path
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -d "$GNULIB_SRCDIR"/.git && test -n "$GNULIB_REVISION" \
|
||||
&& ! git_modules_config submodule.gnulib.url >/dev/null; then
|
||||
(cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || cleanup_gnulib
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# $GNULIB_SRCDIR now points to the version of gnulib to use, and
|
||||
# we no longer need to use git or $gnulib_path below here.
|
||||
# $GNULIB_SRCDIR now points to the version of gnulib to use, and
|
||||
# we no longer need to use git or $gnulib_path below here.
|
||||
|
||||
if $bootstrap_sync; then
|
||||
cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
|
||||
echo "$0: updating bootstrap and restarting..."
|
||||
case $(sh -c 'echo "$1"' -- a) in
|
||||
a) ignored=--;;
|
||||
*) ignored=ignored;;
|
||||
esac
|
||||
exec sh -c \
|
||||
'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
|
||||
$ignored "$GNULIB_SRCDIR/build-aux/bootstrap" \
|
||||
"$0" "$@" --no-bootstrap-sync
|
||||
}
|
||||
if $bootstrap_sync; then
|
||||
cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
|
||||
echo "$0: updating bootstrap and restarting..."
|
||||
case $(sh -c 'echo "$1"' -- a) in
|
||||
a) ignored=--;;
|
||||
*) ignored=ignored;;
|
||||
esac
|
||||
exec sh -c \
|
||||
'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
|
||||
$ignored "$GNULIB_SRCDIR/build-aux/bootstrap" \
|
||||
"$0" "$@" --no-bootstrap-sync
|
||||
}
|
||||
fi
|
||||
|
||||
gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
||||
<$gnulib_tool || exit $?
|
||||
fi
|
||||
|
||||
gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
||||
<$gnulib_tool || exit $?
|
||||
|
||||
# Get translations.
|
||||
|
||||
download_po_files() {
|
||||
subdir=$1
|
||||
domain=$2
|
||||
echo "$me: getting translations into $subdir for $domain..."
|
||||
cmd=$(printf "$po_download_command_format" "$domain" "$subdir")
|
||||
eval "$cmd" && return
|
||||
# Fallback to HTTPS.
|
||||
cmd=$(printf "$po_download_command_format2" "$subdir" "$domain")
|
||||
cmd=$(printf "$po_download_command_format" "$subdir" "$domain")
|
||||
eval "$cmd"
|
||||
}
|
||||
|
||||
@@ -898,36 +932,47 @@ fi
|
||||
|
||||
# Import from gnulib.
|
||||
|
||||
gnulib_tool_options="\
|
||||
--import\
|
||||
--no-changelog\
|
||||
--aux-dir $build_aux\
|
||||
--doc-base $doc_base\
|
||||
--lib $gnulib_name\
|
||||
--m4-base $m4_base/\
|
||||
--source-base $source_base/\
|
||||
--tests-base $tests_base\
|
||||
--local-dir $local_gl_dir\
|
||||
$gnulib_tool_option_extras\
|
||||
"
|
||||
if test $use_libtool = 1; then
|
||||
case "$gnulib_tool_options " in
|
||||
*' --libtool '*) ;;
|
||||
*) gnulib_tool_options="$gnulib_tool_options --libtool" ;;
|
||||
esac
|
||||
fi
|
||||
echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
|
||||
$gnulib_tool $gnulib_tool_options --import $gnulib_modules \
|
||||
|| die "gnulib-tool failed"
|
||||
if $use_gnulib; then
|
||||
gnulib_tool_options="\
|
||||
--no-changelog\
|
||||
--aux-dir=$build_aux\
|
||||
--doc-base=$doc_base\
|
||||
--lib=$gnulib_name\
|
||||
--m4-base=$m4_base/\
|
||||
--source-base=$source_base/\
|
||||
--tests-base=$tests_base\
|
||||
--local-dir=$local_gl_dir\
|
||||
$gnulib_tool_option_extras\
|
||||
"
|
||||
if test $use_libtool = 1; then
|
||||
case "$gnulib_tool_options " in
|
||||
*' --libtool '*) ;;
|
||||
*) gnulib_tool_options="$gnulib_tool_options --libtool" ;;
|
||||
esac
|
||||
fi
|
||||
echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
|
||||
$gnulib_tool $gnulib_tool_options --import $gnulib_modules \
|
||||
|| die "gnulib-tool failed"
|
||||
|
||||
for file in $gnulib_files; do
|
||||
symlink_to_dir "$GNULIB_SRCDIR" $file \
|
||||
|| die "failed to symlink $file"
|
||||
done
|
||||
for file in $gnulib_files; do
|
||||
symlink_to_dir "$GNULIB_SRCDIR" $file \
|
||||
|| die "failed to symlink $file"
|
||||
done
|
||||
fi
|
||||
|
||||
bootstrap_post_import_hook \
|
||||
|| die "bootstrap_post_import_hook failed"
|
||||
|
||||
# Don't proceed if there are uninitialized submodules. In particular,
|
||||
# the next step will remove dangling links, which might be links into
|
||||
# uninitialized submodules.
|
||||
#
|
||||
# Uninitialized submodules are listed with an initial dash.
|
||||
if $use_git && git submodule | grep '^-' >/dev/null; then
|
||||
die "some git submodules are not initialized. " \
|
||||
"Run 'git submodule init' and bootstrap again."
|
||||
fi
|
||||
|
||||
# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
|
||||
# gnulib-populated directories. Such .m4 files would cause aclocal to fail.
|
||||
# The following requires GNU find 4.2.3 or newer. Considering the usual
|
||||
@@ -1020,7 +1065,7 @@ bootstrap_epilogue
|
||||
echo "$0: done. Now you can run './configure'."
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Bootstrap configuration.
|
||||
|
||||
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -38,10 +38,11 @@ gnulib_modules="
|
||||
backup-rename
|
||||
base32
|
||||
base64
|
||||
btowc
|
||||
buffer-lcm
|
||||
c-strcase
|
||||
c-strtod
|
||||
c-strtold
|
||||
cl-strtod
|
||||
cl-strtold
|
||||
calloc-gnu
|
||||
canon-host
|
||||
canonicalize
|
||||
@@ -100,7 +101,6 @@ gnulib_modules="
|
||||
fstatat
|
||||
fsusage
|
||||
fsync
|
||||
ftello
|
||||
ftoastr
|
||||
ftruncate
|
||||
fts
|
||||
@@ -183,6 +183,7 @@ gnulib_modules="
|
||||
nstrftime
|
||||
obstack
|
||||
open
|
||||
openat-safer
|
||||
parse-datetime
|
||||
pathmax
|
||||
perl
|
||||
@@ -211,7 +212,7 @@ gnulib_modules="
|
||||
remove
|
||||
rename
|
||||
renameat
|
||||
renameat2
|
||||
renameatu
|
||||
rmdir
|
||||
root-dev-ino
|
||||
rpmatch
|
||||
@@ -220,6 +221,7 @@ gnulib_modules="
|
||||
save-cwd
|
||||
savedir
|
||||
savewd
|
||||
select
|
||||
selinux-at
|
||||
setenv
|
||||
settime
|
||||
@@ -238,9 +240,7 @@ gnulib_modules="
|
||||
strdup-posix
|
||||
strncat
|
||||
strnumcmp
|
||||
strpbrk
|
||||
strsignal
|
||||
strtod
|
||||
strtoimax
|
||||
strtoumax
|
||||
symlinkat
|
||||
@@ -259,6 +259,7 @@ gnulib_modules="
|
||||
unistd-safer
|
||||
unlink-busy
|
||||
unlinkat
|
||||
unlinkdir
|
||||
unlocked-io
|
||||
unsetenv
|
||||
update-copyright
|
||||
@@ -272,6 +273,7 @@ gnulib_modules="
|
||||
verify
|
||||
verror
|
||||
version-etc-fsf
|
||||
wchar-single
|
||||
wcswidth
|
||||
wcwidth
|
||||
winsz-ioctl
|
||||
|
||||
@@ -45,6 +45,7 @@ normal_progs='
|
||||
b2sum
|
||||
base64
|
||||
base32
|
||||
basenc
|
||||
basename
|
||||
cat
|
||||
chcon
|
||||
|
||||
24
cfg.mk
24
cfg.mk
@@ -1,5 +1,5 @@
|
||||
# Customize maint.mk -*- makefile -*-
|
||||
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -48,7 +48,7 @@ export VERBOSE = yes
|
||||
# 4914152 9e
|
||||
export XZ_OPT = -8e
|
||||
|
||||
old_NEWS_hash = 8c2a749f657a6bd541e8b9c5227fe26f
|
||||
old_NEWS_hash = 79133b52351baf64693804eed58a0cbc
|
||||
|
||||
# Add an exemption for sc_makefile_at_at_check.
|
||||
_makefile_at_at_check_exceptions = ' && !/^cu_install_prog/ && !/dynamic-dep/'
|
||||
@@ -250,6 +250,11 @@ sc_prohibit-quotearg:
|
||||
halt='Unstyled diagnostic quoting detected' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
sc_prohibit-skip:
|
||||
@prohibit='\|\| skip ' \
|
||||
halt='Use skip_ not skip' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
sc_sun_os_names:
|
||||
@grep -nEi \
|
||||
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
|
||||
@@ -787,11 +792,13 @@ sc_gitignore_missing:
|
||||
'entries to .gitignore' >&2; exit 1; } || :
|
||||
|
||||
# Flag redundant entries in .gitignore
|
||||
sc_gitignore_redundant:
|
||||
@{ grep ^/lib $(srcdir)/.gitignore; \
|
||||
sed 's|^|/lib|' $(srcdir)/lib/.gitignore; } | \
|
||||
sort | uniq -d | grep . && { echo '$(ME): Remove above' \
|
||||
'entries from .gitignore' >&2; exit 1; } || :
|
||||
# Disabled for now as too aggressive flagging
|
||||
# entries like /lib/arg-nonnull.h
|
||||
#sc_gitignore_redundant:
|
||||
# @{ grep ^/lib $(srcdir)/.gitignore; \
|
||||
# sed 's|^|/lib|' $(srcdir)/lib/.gitignore; } | \
|
||||
# sort | uniq -d | grep . && { echo '$(ME): Remove above' \
|
||||
# 'entries from .gitignore' >&2; exit 1; } || :
|
||||
|
||||
sc_prohibit-form-feed:
|
||||
@prohibit=$$'\f' \
|
||||
@@ -821,8 +828,9 @@ exclude_file_name_regexp--sc_system_h_headers = \
|
||||
^src/((die|system|copy)\.h|make-prime-list\.c)$$
|
||||
|
||||
_src = (false|lbracket|ls-(dir|ls|vdir)|tac-pipe|uname-(arch|uname))
|
||||
_gl_src = (xdecto.max|cl-strtold)
|
||||
exclude_file_name_regexp--sc_require_config_h_first = \
|
||||
(^lib/buffer-lcm\.c|gl/lib/xdecto.max\.c|src/$(_src)\.c)$$
|
||||
(^lib/buffer-lcm\.c|gl/lib/$(_gl_src)\.c|src/$(_src)\.c)$$
|
||||
exclude_file_name_regexp--sc_require_config_h = \
|
||||
$(exclude_file_name_regexp--sc_require_config_h_first)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
# Copyright (C) 1991-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -130,7 +130,6 @@ if test "$gl_gcc_warnings" = yes; then
|
||||
nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat
|
||||
nw="$nw -Wlogical-op" # Too many warnings until GCC 4.8.0
|
||||
nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses
|
||||
nw="$nw -Wvla" # warnings in gettext.h
|
||||
nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__
|
||||
nw="$nw -Wswitch-enum" # Too many warnings for now
|
||||
nw="$nw -Wswitch-default" # Too many warnings for now
|
||||
@@ -318,6 +317,9 @@ if test $ac_cv_func_getattrat = yes; then
|
||||
AC_SUBST([LIB_NVPAIR])
|
||||
fi
|
||||
|
||||
# glibc >= 2.28 and linux kernel >= 4.11
|
||||
AC_CHECK_FUNCS([statx])
|
||||
|
||||
# SCO-ODT-3.0 is reported to need -los to link programs using initgroups
|
||||
AC_CHECK_FUNCS([initgroups])
|
||||
if test $ac_cv_func_initgroups = no; then
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
# Make coreutils documentation. -*-Makefile-*-
|
||||
# This is included by the top-level Makefile.am.
|
||||
|
||||
# Copyright (C) 1995-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
114
doc/perm.texi
114
doc/perm.texi
@@ -1,6 +1,6 @@
|
||||
@c File mode bits
|
||||
|
||||
@c Copyright (C) 1994-2017 Free Software Foundation, Inc.
|
||||
@c Copyright (C) 1994-2019 Free Software Foundation, Inc.
|
||||
|
||||
@c Permission is granted to copy, distribute and/or modify this document
|
||||
@c under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
@@ -70,38 +70,36 @@ In addition to the three sets of three permissions listed above, the
|
||||
file mode bits have three special components, which affect only
|
||||
executable files (programs) and, on most systems, directories:
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
@table @asis
|
||||
@item The @dfn{set-user-ID bit} (@dfn{setuid bit}).
|
||||
@cindex set-user-ID
|
||||
@cindex setuid
|
||||
Set the process's effective user ID to that of the file upon execution
|
||||
(called the @dfn{set-user-ID bit}, or sometimes the @dfn{setuid bit}).
|
||||
On execution, set the process's effective user ID to that of the file.
|
||||
For directories on a few systems, give files created in the directory
|
||||
the same owner as the directory, no matter who creates them, and set
|
||||
the set-user-ID bit of newly-created subdirectories.
|
||||
@item
|
||||
|
||||
@item The @dfn{set-group-ID bit} (@dfn{setgid bit}).
|
||||
@cindex set-group-ID
|
||||
@cindex setgid
|
||||
Set the process's effective group ID to that of the file upon execution
|
||||
(called the @dfn{set-group-ID bit}, or sometimes the @dfn{setgid bit}).
|
||||
On execution, set the process's effective group ID to that of the file.
|
||||
For directories on most systems, give files created in the directory
|
||||
the same group as the directory, no matter what group the user who
|
||||
creates them is in, and set the set-group-ID bit of newly-created
|
||||
subdirectories.
|
||||
@item
|
||||
|
||||
@item The @dfn{restricted deletion flag} or @dfn{sticky bit}.
|
||||
@cindex sticky
|
||||
@cindex swap space, saving text image in
|
||||
@cindex text image, saving in swap space
|
||||
@cindex restricted deletion flag
|
||||
Prevent unprivileged users from removing or renaming a file in a directory
|
||||
unless they own the file or the directory; this is called the
|
||||
@dfn{restricted deletion flag} for the directory, and is commonly
|
||||
unless they own the file or the directory; this is commonly
|
||||
found on world-writable directories like @file{/tmp}.
|
||||
|
||||
For regular files on some older systems, save the program's text image on the
|
||||
swap device so it will load more quickly when run; this is called the
|
||||
@dfn{sticky bit}.
|
||||
@end enumerate
|
||||
swap device so it will load more quickly when run, so that the image
|
||||
is ``sticky''.
|
||||
@end table
|
||||
|
||||
In addition to the file mode bits listed above, there may be file attributes
|
||||
specific to the file system, e.g., access control lists (ACLs), whether a
|
||||
@@ -494,10 +492,47 @@ the file to all users.
|
||||
As an
|
||||
alternative to giving a symbolic mode, you can give an octal (base 8)
|
||||
number that represents the mode.
|
||||
This number is always interpreted in octal; you do not have to add a
|
||||
leading @samp{0}, as you do in C. Mode @samp{0055} is the same as
|
||||
mode @samp{55}. (However, modes of five digits or more, such as
|
||||
@samp{00055}, are sometimes special. @xref{Directory Setuid and Setgid}.)
|
||||
|
||||
The permissions granted to the user,
|
||||
to other users in the file's group,
|
||||
and to other users not in the file's group each require three
|
||||
bits: one bit for read, one for write, and one for execute/search permission.
|
||||
These three bits are represented as one octal digit;
|
||||
for example, if all three are present, the resulting 111 (in binary)
|
||||
is represented as the digit 7 (in octal). The three special
|
||||
mode bits also require one bit each, and they are as a group
|
||||
represented as another octal digit. Here is how the bits are arranged,
|
||||
starting with the highest valued bit:
|
||||
|
||||
@example
|
||||
Value in Corresponding
|
||||
Mode Mode Bit
|
||||
|
||||
Special mode bits:
|
||||
4000 Set user ID
|
||||
2000 Set group ID
|
||||
1000 Restricted deletion flag or sticky bit
|
||||
|
||||
The file's owner:
|
||||
400 Read
|
||||
200 Write
|
||||
100 Execute/search
|
||||
|
||||
Other users in the file's group:
|
||||
40 Read
|
||||
20 Write
|
||||
10 Execute/search
|
||||
|
||||
Other users not in the file's group:
|
||||
4 Read
|
||||
2 Write
|
||||
1 Execute/search
|
||||
@end example
|
||||
|
||||
For example, numeric mode @samp{4751} corresponds to symbolic mode
|
||||
@samp{u=srwx,g=rx,o=x}, and numeric mode @samp{664} corresponds to symbolic mode
|
||||
@samp{ug=rw,o=r}. Numeric mode @samp{0} corresponds to symbolic mode
|
||||
@samp{a=}.
|
||||
|
||||
A numeric mode is usually shorter than the corresponding symbolic
|
||||
mode, but it is limited in that normally it cannot take into account the
|
||||
@@ -507,43 +542,10 @@ to this general limitation. @xref{Directory Setuid and Setgid}.
|
||||
Also, operator numeric modes can take previous file mode bits into
|
||||
account. @xref{Operator Numeric Modes}.
|
||||
|
||||
The permissions granted to the user,
|
||||
to other users in the file's group,
|
||||
and to other users not in the file's group each require three
|
||||
bits, which are represented as one octal digit. The three special
|
||||
mode bits also require one bit each, and they are as a group
|
||||
represented as another octal digit. Here is how the bits are arranged,
|
||||
starting with the lowest valued bit:
|
||||
|
||||
@example
|
||||
Value in Corresponding
|
||||
Mode Mode Bit
|
||||
|
||||
Other users not in the file's group:
|
||||
1 Execute/search
|
||||
2 Write
|
||||
4 Read
|
||||
|
||||
Other users in the file's group:
|
||||
10 Execute/search
|
||||
20 Write
|
||||
40 Read
|
||||
|
||||
The file's owner:
|
||||
100 Execute/search
|
||||
200 Write
|
||||
400 Read
|
||||
|
||||
Special mode bits:
|
||||
1000 Restricted deletion flag or sticky bit
|
||||
2000 Set group ID on execution
|
||||
4000 Set user ID on execution
|
||||
@end example
|
||||
|
||||
For example, numeric mode @samp{4755} corresponds to symbolic mode
|
||||
@samp{u=rwxs,go=rx}, and numeric mode @samp{664} corresponds to symbolic mode
|
||||
@samp{ug=rw,o=r}. Numeric mode @samp{0} corresponds to symbolic mode
|
||||
@samp{a=}.
|
||||
Numeric modes are always interpreted in octal; you do not have to add a
|
||||
leading @samp{0}, as you do in C@. Mode @samp{0055} is the same as
|
||||
mode @samp{55}. However, modes of five digits or more, such as
|
||||
@samp{00055}, are sometimes special (@pxref{Directory Setuid and Setgid}).
|
||||
|
||||
@node Operator Numeric Modes
|
||||
@section Operator Numeric Modes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* buffer-lcm.c - compute a good buffer size for dealing with two files
|
||||
|
||||
Copyright (C) 2002-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
76
gl/lib/cl-strtod.c
Normal file
76
gl/lib/cl-strtod.c
Normal file
@@ -0,0 +1,76 @@
|
||||
/* Convert string to double in the current locale, falling back on the C locale.
|
||||
|
||||
Copyright 2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "cl-strtod.h"
|
||||
|
||||
#include <c-strtod.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if LONG
|
||||
# define CL_STRTOD cl_strtold
|
||||
# define DOUBLE long double
|
||||
# define C_STRTOD c_strtold
|
||||
# define STRTOD strtold
|
||||
#else
|
||||
# define CL_STRTOD cl_strtod
|
||||
# define DOUBLE double
|
||||
# define C_STRTOD c_strtod
|
||||
# define STRTOD strtod
|
||||
#endif
|
||||
|
||||
/* This function acts like strtod or strtold, except that it falls
|
||||
back on the C locale if the initial prefix is not parsable in
|
||||
the current locale. If the prefix is parsable in both locales,
|
||||
it uses the longer parse, breaking ties in favor of the current locale.
|
||||
|
||||
Parse the initial prefix of NPTR as a floating-point number in the
|
||||
current locale or in the C locale (preferring the locale that
|
||||
yields the longer parse, or the current locale if there is a tie).
|
||||
If ENDPTR is not NULL, set *ENDPTR to the first unused byte, or to
|
||||
NPTR if the prefix cannot be parsed.
|
||||
|
||||
If successful, return a number without changing errno.
|
||||
If the prefix cannot be parsed, return 0 and possibly set errno to EINVAL.
|
||||
If the number overflows, return an extreme value and set errno to ERANGE.
|
||||
If the number underflows, return a value close to 0 and set errno to ERANGE.
|
||||
If there is some other error, return 0 and set errno. */
|
||||
|
||||
DOUBLE
|
||||
CL_STRTOD (char const *nptr, char **restrict endptr)
|
||||
{
|
||||
char *end;
|
||||
DOUBLE d = STRTOD (nptr, &end);
|
||||
if (*end)
|
||||
{
|
||||
int strtod_errno = errno;
|
||||
char *c_end;
|
||||
DOUBLE c = C_STRTOD (nptr, &c_end);
|
||||
if (end < c_end)
|
||||
d = c, end = c_end;
|
||||
else
|
||||
errno = strtod_errno;
|
||||
}
|
||||
if (endptr)
|
||||
*endptr = end;
|
||||
return d;
|
||||
}
|
||||
2
gl/lib/cl-strtod.h
Normal file
2
gl/lib/cl-strtod.h
Normal file
@@ -0,0 +1,2 @@
|
||||
double cl_strtod (char const *, char **restrict);
|
||||
long double cl_strtold (char const *, char **restrict);
|
||||
2
gl/lib/cl-strtold.c
Normal file
2
gl/lib/cl-strtold.c
Normal file
@@ -0,0 +1,2 @@
|
||||
#define LONG 1
|
||||
#include "cl-strtod.c"
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Declare an access pattern hint for files.
|
||||
Copyright (C) 2010-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Declare an access pattern hint for files.
|
||||
Copyright (C) 2010-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Invoke open, but return either a desired file descriptor or -1.
|
||||
|
||||
Copyright (C) 2005-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Invoke open, but return either a desired file descriptor or -1.
|
||||
|
||||
Copyright (C) 2005-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Barebones heap implementation supporting only insert and pop.
|
||||
|
||||
Copyright (C) 2010-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Barebones heap implementation supporting only insert and pop.
|
||||
|
||||
Copyright (C) 2010-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Align/Truncate a string in a given screen width
|
||||
Copyright (C) 2009-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2009-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Align/Truncate a string in a given screen width
|
||||
Copyright (C) 2009-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2009-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Bob Jenkins's cryptographic random number generators, ISAAC and ISAAC64.
|
||||
|
||||
Copyright (C) 1999-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1998, 1999 Colin Plumb.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Bob Jenkins's cryptographic random number generators, ISAAC and ISAAC64.
|
||||
|
||||
Copyright (C) 1999-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1998, 1999 Colin Plumb.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Generate random integers.
|
||||
|
||||
Copyright (C) 2006-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Generate random integers.
|
||||
|
||||
Copyright (C) 2006-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Generate random permutations.
|
||||
|
||||
Copyright (C) 2006-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Generate buffers of random data.
|
||||
|
||||
Copyright (C) 2006-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Generate buffers of random data.
|
||||
|
||||
Copyright (C) 2006-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* root-dev-ino.c -- get the device and inode numbers for '/'.
|
||||
Copyright (C) 2003-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Root device and inode number checking.
|
||||
|
||||
Copyright (C) 2003-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Include and determine availability of smack routines
|
||||
Copyright (C) 2013-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2013-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Compare integer strings.
|
||||
|
||||
Copyright (C) 2005-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Compare numeric strings. This is an internal include file.
|
||||
|
||||
Copyright (C) 1988-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Compare numeric strings.
|
||||
|
||||
Copyright (C) 2005-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Convert decimal strings with bounds checking and exit on error.
|
||||
|
||||
Copyright (C) 2014-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2014-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Convert decimal strings with bounds checking and exit on error.
|
||||
|
||||
Copyright (C) 2014-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2014-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* xfts.c -- a wrapper for fts_open
|
||||
|
||||
Copyright (C) 2003-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
24
gl/modules/cl-strtod
Normal file
24
gl/modules/cl-strtod
Normal file
@@ -0,0 +1,24 @@
|
||||
Description:
|
||||
Convert string to double in current or C locale.
|
||||
|
||||
Files:
|
||||
lib/cl-strtod.c
|
||||
lib/cl-strtod.h
|
||||
|
||||
Depends-on:
|
||||
c-strtod
|
||||
|
||||
configure.ac:
|
||||
AC_REQUIRE([AC_C_RESTRICT])
|
||||
|
||||
Makefile.am:
|
||||
lib_SOURCES += cl-strtod.c
|
||||
|
||||
Include:
|
||||
"cl-strtod.h"
|
||||
|
||||
License:
|
||||
GPL
|
||||
|
||||
Maintainer:
|
||||
all
|
||||
25
gl/modules/cl-strtold
Normal file
25
gl/modules/cl-strtold
Normal file
@@ -0,0 +1,25 @@
|
||||
Description:
|
||||
Convert string to long double in current or C locale.
|
||||
|
||||
Files:
|
||||
lib/cl-strtod.c
|
||||
lib/cl-strtod.h
|
||||
lib/cl-strtold.c
|
||||
|
||||
Depends-on:
|
||||
c-strtold
|
||||
|
||||
configure.ac:
|
||||
AC_REQUIRE([AC_C_RESTRICT])
|
||||
|
||||
Makefile.am:
|
||||
lib_SOURCES += cl-strtold.c
|
||||
|
||||
Include:
|
||||
"cl-strtod.h"
|
||||
|
||||
License:
|
||||
GPL
|
||||
|
||||
Maintainer:
|
||||
all
|
||||
@@ -2,10 +2,10 @@ diff --git a/modules/tempname b/modules/tempname
|
||||
index 570ea54..f1be8ff 100644
|
||||
--- a/modules/tempname
|
||||
+++ b/modules/tempname
|
||||
@@ -12,6 +12,8 @@
|
||||
fcntl-h
|
||||
@@ -13,6 +13,8 @@
|
||||
gettimeofday
|
||||
lstat
|
||||
mkdir
|
||||
+randint
|
||||
+stdbool
|
||||
stdint
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Test that fadvise works as advertised.
|
||||
Copyright (C) 2010-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Test that mbsalign works as advertised.
|
||||
Copyright (C) 2010-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Test the ISAAC or ISAAC64 pseudorandom number generator.
|
||||
|
||||
Copyright (C) 2010-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
2
gnulib
2
gnulib
Submodule gnulib updated: 21d224dc9e...188d87b051
10
init.cfg
10
init.cfg
@@ -1,6 +1,6 @@
|
||||
# This file is sourced by init.sh, *before* its initialization.
|
||||
|
||||
# Copyright (C) 2010-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2010-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -492,7 +492,7 @@ require_membership_in_two_groups_()
|
||||
*' '*) ;;
|
||||
*) skip_ 'requires membership in two groups
|
||||
this test requires that you be a member of more than one group,
|
||||
but running 'id -G'\'' either failed or found just one. If you really
|
||||
but running '\''id -G'\'' either failed or found just one. If you really
|
||||
are a member of at least two groups, then rerun this test with
|
||||
COREUTILS_GROUPS set in your environment to the space-separated list
|
||||
of group names or numbers. E.g.,
|
||||
@@ -610,6 +610,12 @@ mkfifo_or_skip_()
|
||||
fi
|
||||
}
|
||||
|
||||
trap_sigpipe_or_skip_()
|
||||
{
|
||||
(trap '' PIPE && yes | :) 2>&1 | grep -qF 'Broken pipe' ||
|
||||
skip_ 'trapping SIGPIPE is not supported'
|
||||
}
|
||||
|
||||
# Disable the current test if the working directory seems to have
|
||||
# the setgid bit set.
|
||||
skip_if_setgid_()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# Exercise chdir-long's sample main program.
|
||||
|
||||
# Copyright (C) 2005-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# boottime.m4 serial 4
|
||||
# Determine whether this system has infrastructure for obtaining the boot time.
|
||||
|
||||
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#serial 26
|
||||
# Check declarations for this package.
|
||||
|
||||
dnl Copyright (C) 1997-2017 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 1997-2019 Free Software Foundation, Inc.
|
||||
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Tests for GNU GMP (or any compatible replacement).
|
||||
|
||||
dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2008-2019 Free Software Foundation, Inc.
|
||||
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#serial 2
|
||||
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2007-2019 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
dnl Misc type-related macros for coreutils.
|
||||
|
||||
# Copyright (C) 1998-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1998-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -41,6 +41,10 @@ AC_DEFUN([coreutils_MACROS],
|
||||
AC_DEFINE([ARGMATCH_DIE_DECL], [void usage (int _e)],
|
||||
[Define to the declaration of the xargmatch failure function.])
|
||||
|
||||
# Ensure VLAs are not used.
|
||||
# Note -Wvla is implicitly added by gl_MANYWARN_ALL_GCC
|
||||
AC_DEFINE([GNULIB_NO_VLA], [1], [Define to 1 to disable use of VLAs])
|
||||
|
||||
# used by shred
|
||||
AC_CHECK_FUNCS_ONCE([directio])
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
|
||||
# directory of the coreutils package.
|
||||
|
||||
|
||||
# Copyright (C) 1998-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1998-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# stat-prog.m4 serial 7
|
||||
# Record the prerequisites of src/stat.c from the coreutils package.
|
||||
|
||||
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# xattr.m4 - check for Extended Attributes (Linux)
|
||||
# serial 3
|
||||
|
||||
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003-2019 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
1
man/.gitignore
vendored
1
man/.gitignore
vendored
@@ -3,6 +3,7 @@ Makefile.in
|
||||
b2sum.1
|
||||
base32.1
|
||||
base64.1
|
||||
basenc.1
|
||||
basename.1
|
||||
cat.1
|
||||
chgrp.1
|
||||
|
||||
38
man/basenc.x
Normal file
38
man/basenc.x
Normal file
@@ -0,0 +1,38 @@
|
||||
'\" Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
'\"
|
||||
'\" This is free software. You may redistribute copies of it under the terms
|
||||
'\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
|
||||
'\" There is NO WARRANTY, to the extent permitted by law.
|
||||
[NAME]
|
||||
basenc \- Encode/decode data and print to standard output
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
[ENCODINGS EXAMPLES]
|
||||
.PP
|
||||
.nf
|
||||
.RS
|
||||
$ printf '\\376\\117\\202' | basenc \-\-base64
|
||||
/k+C
|
||||
|
||||
$ printf '\\376\\117\\202' | basenc \-\-base64url
|
||||
_k-C
|
||||
|
||||
$ printf '\\376\\117\\202' | basenc \-\-base32
|
||||
7ZHYE===
|
||||
|
||||
$ printf '\\376\\117\\202' | basenc \-\-base32hex
|
||||
VP7O4===
|
||||
|
||||
$ printf '\\376\\117\\202' | basenc \-\-base16
|
||||
FE4F82
|
||||
|
||||
$ printf '\\376\\117\\202' | basenc \-\-base2lsbf
|
||||
011111111111001001000001
|
||||
|
||||
$ printf '\\376\\117\\202' | basenc \-\-base2msbf
|
||||
111111100100111110000010
|
||||
|
||||
$ printf '\\376\\117\\202\\000' | basenc \-\-z85
|
||||
@.FaC
|
||||
.RE
|
||||
.fi
|
||||
@@ -1,4 +1,4 @@
|
||||
'\" Copyright (C) 1998-2017 Free Software Foundation, Inc.
|
||||
'\" Copyright (C) 1998-2019 Free Software Foundation, Inc.
|
||||
'\"
|
||||
'\" This is free software. You may redistribute copies of it under the terms
|
||||
'\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
'\" Copyright (C) 1998-2017 Free Software Foundation, Inc.
|
||||
'\" Copyright (C) 1998-2019 Free Software Foundation, Inc.
|
||||
'\"
|
||||
'\" This is free software. You may redistribute copies of it under the terms
|
||||
'\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
|
||||
|
||||
2
man/df.x
2
man/df.x
@@ -1,4 +1,4 @@
|
||||
'\" Copyright (C) 1998-2017 Free Software Foundation, Inc.
|
||||
'\" Copyright (C) 1998-2019 Free Software Foundation, Inc.
|
||||
'\"
|
||||
'\" This is free software. You may redistribute copies of it under the terms
|
||||
'\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
|
||||
|
||||
14
man/du.x
14
man/du.x
@@ -1,4 +1,4 @@
|
||||
'\" Copyright (C) 1998-2017 Free Software Foundation, Inc.
|
||||
'\" Copyright (C) 1998-2019 Free Software Foundation, Inc.
|
||||
'\"
|
||||
'\" This is free software. You may redistribute copies of it under the terms
|
||||
'\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
|
||||
@@ -9,20 +9,20 @@ du \- estimate file space usage
|
||||
.\" Add any additional description here
|
||||
[PATTERNS]
|
||||
PATTERN is a shell pattern (not a regular expression). The pattern
|
||||
.BR ?
|
||||
.B ?\&
|
||||
matches any one character, whereas
|
||||
.BR *
|
||||
.B *
|
||||
matches any string (composed of zero, one or multiple characters). For
|
||||
example,
|
||||
.BR *.o
|
||||
.B *.o
|
||||
will match any files whose names end in
|
||||
.BR .o .
|
||||
Therefore, the command
|
||||
.IP
|
||||
.B du --exclude=\(aq*.o\(aq
|
||||
.B du \-\-exclude=\(aq*.o\(aq
|
||||
.PP
|
||||
will skip all files and subdirectories ending in
|
||||
.BR .o
|
||||
.B .o
|
||||
(including the file
|
||||
.BR .o
|
||||
.B .o
|
||||
itself).
|
||||
|
||||
63
man/env.x
63
man/env.x
@@ -1,4 +1,67 @@
|
||||
'\" Copyright (C) 1998-2019 Free Software Foundation, Inc.
|
||||
'\"
|
||||
'\" This is free software. You may redistribute copies of it under the terms
|
||||
'\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
|
||||
'\" There is NO WARRANTY, to the extent permitted by law.
|
||||
[NAME]
|
||||
env \- run a program in a modified environment
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
[OPTIONS]
|
||||
.SS "\-S/\-\-split\-string usage in scripts"
|
||||
The
|
||||
.B \-S
|
||||
option allows specifying multiple parameters in a script.
|
||||
Running a script named
|
||||
.B 1.pl
|
||||
containing the following first line:
|
||||
.PP
|
||||
.RS
|
||||
.nf
|
||||
#!/usr/bin/env \-S perl \-w \-T
|
||||
\&...
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
Will execute
|
||||
.B "perl \-w \-T 1.pl".
|
||||
.PP
|
||||
Without the
|
||||
.B '\-S'
|
||||
parameter the script will likely fail with:
|
||||
.PP
|
||||
.RS
|
||||
.nf
|
||||
/usr/bin/env: 'perl \-w \-T': No such file or directory
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
See the full documentation for more details.
|
||||
.PP
|
||||
.SS "\-\-default-signal[=SIG]" usage
|
||||
This option allows setting a signal handler to its default
|
||||
action, which is not possible using the traditional shell
|
||||
trap command. The following example ensures that seq
|
||||
will be terminated by SIGPIPE no matter how this signal
|
||||
is being handled in the process invoking the command.
|
||||
|
||||
.PP
|
||||
.RS
|
||||
.nf
|
||||
sh \-c 'env \-\-default-signal=PIPE seq inf | head \-n1'
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
|
||||
[NOTES]
|
||||
POSIX's exec(2) pages says:
|
||||
.RS
|
||||
"many existing applications wrongly assume that they start with certain
|
||||
signals set to the default action and/or unblocked.... Therefore, it is best
|
||||
not to block or ignore signals across execs without explicit reason to do so,
|
||||
and especially not to block signals across execs of arbitrary (not closely
|
||||
cooperating) programs."
|
||||
.RE
|
||||
|
||||
[SEE ALSO]
|
||||
sigaction(2), sigprocmask(2), signal(7)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Make coreutils man pages. -*-Makefile-*-
|
||||
# This is included by the top-level Makefile.am.
|
||||
|
||||
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -69,6 +69,7 @@ man/b2sum.1: src/b2sum$(EXEEXT)
|
||||
man/base32.1: src/base32$(EXEEXT)
|
||||
man/base64.1: src/base64$(EXEEXT)
|
||||
man/basename.1: src/basename$(EXEEXT)
|
||||
man/basenc.1: src/basenc$(EXEEXT)
|
||||
man/cat.1: src/cat$(EXEEXT)
|
||||
man/chcon.1: src/chcon$(EXEEXT)
|
||||
man/chgrp.1: src/chgrp$(EXEEXT)
|
||||
|
||||
6
man/rm.x
6
man/rm.x
@@ -1,4 +1,4 @@
|
||||
'\" Copyright (C) 1998-2017 Free Software Foundation, Inc.
|
||||
'\" Copyright (C) 1998-2019 Free Software Foundation, Inc.
|
||||
'\"
|
||||
'\" This is free software. You may redistribute copies of it under the terms
|
||||
'\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
|
||||
@@ -13,7 +13,7 @@ documents the GNU version of
|
||||
removes each specified file. By default, it does not remove
|
||||
directories.
|
||||
.P
|
||||
If the \fI\-I\fR or \fI\-\-interactive\=once\fR option is given,
|
||||
If the \fI\-I\fR or \fI\-\-interactive=once\fR option is given,
|
||||
and there are more than three files or the \fI\-r\fR, \fI\-R\fR,
|
||||
or \fI\-\-recursive\fR are given, then
|
||||
.B rm
|
||||
@@ -22,7 +22,7 @@ the response is not affirmative, the entire command is aborted.
|
||||
.P
|
||||
Otherwise, if a file is unwritable, standard input is a terminal, and
|
||||
the \fI\-f\fR or \fI\-\-force\fR option is not given, or the
|
||||
\fI\-i\fR or \fI\-\-interactive\=always\fR option is given,
|
||||
\fI\-i\fR or \fI\-\-interactive=always\fR option is given,
|
||||
.B rm
|
||||
prompts the user for whether to remove the file. If the response is
|
||||
not affirmative, the file is skipped.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
'\" Copyright (C) 2009-2017 Free Software Foundation, Inc.
|
||||
'\" Copyright (C) 2009-2019 Free Software Foundation, Inc.
|
||||
'\"
|
||||
'\" This is free software. You may redistribute copies of it under the terms
|
||||
'\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
|
||||
|
||||
15
man/test.x
15
man/test.x
@@ -1,4 +1,19 @@
|
||||
[NAME]
|
||||
test \- check file types and compare values
|
||||
[SYNOPSIS]
|
||||
.B test
|
||||
.I EXPRESSION
|
||||
.br
|
||||
.B test
|
||||
.br
|
||||
.\" \& tells doclifter the brackets are literal (Bug#31803).
|
||||
.B [\&
|
||||
.I EXPRESSION
|
||||
.B ]\&
|
||||
.br
|
||||
.B "[\& ]\&"
|
||||
.br
|
||||
.B [\&
|
||||
.I OPTION
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# List of files which contain translatable strings.
|
||||
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
|
||||
# These are nominally temporary...
|
||||
lib/argmatch.c
|
||||
@@ -33,8 +33,8 @@ lib/xstrtol-error.c
|
||||
|
||||
# Package source files
|
||||
|
||||
src/base64.c
|
||||
src/basename.c
|
||||
src/basenc.c
|
||||
src/cat.c
|
||||
src/chcon.c
|
||||
src/chgrp.c
|
||||
|
||||
@@ -14,10 +14,10 @@ $editor = "vi" if $? != 0 or $editor =~ /^\s*\z/;
|
||||
# Keywords allowed before the colon on the first line of a commit message:
|
||||
# program names and a few general category names.
|
||||
my @valid = qw(
|
||||
arch b2sum base32 base64 basename cat chcon chgrp chmod chown chroot cksum
|
||||
comm cp csplit cut date dd df dir dircolors dirname du echo env expand
|
||||
expr factor false fmt fold groups head hostid hostname id install
|
||||
join kill link ln logname ls md5sum mkdir mkfifo mknod mktemp
|
||||
arch b2sum base32 base64 basenc nbasename cat chcon chgrp chmod chown
|
||||
chroot cksum comm cp csplit cut date dd df dir dircolors dirname du echo
|
||||
env expand expr factor false fmt fold groups head hostid hostname id
|
||||
install join kill link ln logname ls md5sum mkdir mkfifo mknod mktemp
|
||||
mv nice nl nohup nproc numfmt od paste pathchk pinky pr printenv printf
|
||||
ptx pwd readlink realpath rm rmdir runcon seq sha1sum sha224sum sha256sum
|
||||
sha384sum sha512sum shred shuf sleep sort split stat stdbuf stty
|
||||
|
||||
1
src/.gitignore
vendored
1
src/.gitignore
vendored
@@ -5,6 +5,7 @@ arch
|
||||
b2sum
|
||||
base32
|
||||
base64
|
||||
basenc
|
||||
basename
|
||||
cat
|
||||
chcon
|
||||
|
||||
350
src/base64.c
350
src/base64.c
@@ -1,350 +0,0 @@
|
||||
/* Base64 encode/decode strings or files.
|
||||
Copyright (C) 2004-2017 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Base64.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Simon Josefsson <simon@josefsson.org>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "system.h"
|
||||
#include "die.h"
|
||||
#include "error.h"
|
||||
#include "fadvise.h"
|
||||
#include "quote.h"
|
||||
#include "xstrtol.h"
|
||||
#include "xdectoint.h"
|
||||
#include "xbinary-io.h"
|
||||
|
||||
#define AUTHORS proper_name ("Simon Josefsson")
|
||||
|
||||
#if BASE_TYPE == 32
|
||||
# include "base32.h"
|
||||
# define PROGRAM_NAME "base32"
|
||||
#else
|
||||
# include "base64.h"
|
||||
# define PROGRAM_NAME "base64"
|
||||
#endif
|
||||
|
||||
|
||||
static struct option const long_options[] =
|
||||
{
|
||||
{"decode", no_argument, 0, 'd'},
|
||||
{"wrap", required_argument, 0, 'w'},
|
||||
{"ignore-garbage", no_argument, 0, 'i'},
|
||||
|
||||
{GETOPT_HELP_OPTION_DECL},
|
||||
{GETOPT_VERSION_OPTION_DECL},
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
void
|
||||
usage (int status)
|
||||
{
|
||||
if (status != EXIT_SUCCESS)
|
||||
emit_try_help ();
|
||||
else
|
||||
{
|
||||
printf (_("\
|
||||
Usage: %s [OPTION]... [FILE]\n\
|
||||
Base%d encode or decode FILE, or standard input, to standard output.\n\
|
||||
"), program_name, BASE_TYPE);
|
||||
|
||||
emit_stdin_note ();
|
||||
emit_mandatory_arg_note ();
|
||||
|
||||
fputs (_("\
|
||||
-d, --decode decode data\n\
|
||||
-i, --ignore-garbage when decoding, ignore non-alphabet characters\n\
|
||||
-w, --wrap=COLS wrap encoded lines after COLS character (default 76).\n\
|
||||
Use 0 to disable line wrapping\n\
|
||||
\n\
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\
|
||||
\n\
|
||||
The data are encoded as described for the %s alphabet in RFC 4648.\n\
|
||||
When decoding, the input may contain newlines in addition to the bytes of\n\
|
||||
the formal %s alphabet. Use --ignore-garbage to attempt to recover\n\
|
||||
from any other non-alphabet bytes in the encoded stream.\n"),
|
||||
PROGRAM_NAME, PROGRAM_NAME);
|
||||
emit_ancillary_info (PROGRAM_NAME);
|
||||
}
|
||||
|
||||
exit (status);
|
||||
}
|
||||
|
||||
#define ENC_BLOCKSIZE (1024*3*10)
|
||||
|
||||
#if BASE_TYPE == 32
|
||||
# define BASE_LENGTH BASE32_LENGTH
|
||||
/* Note that increasing this may decrease performance if --ignore-garbage
|
||||
is used, because of the memmove operation below. */
|
||||
# define DEC_BLOCKSIZE (1024*5)
|
||||
|
||||
/* Ensure that BLOCKSIZE is a multiple of 5 and 8. */
|
||||
verify (ENC_BLOCKSIZE % 40 == 0); /* So padding chars only on last block. */
|
||||
verify (DEC_BLOCKSIZE % 40 == 0); /* So complete encoded blocks are used. */
|
||||
|
||||
# define base_encode base32_encode
|
||||
# define base_decode_context base32_decode_context
|
||||
# define base_decode_ctx_init base32_decode_ctx_init
|
||||
# define base_decode_ctx base32_decode_ctx
|
||||
# define isbase isbase32
|
||||
#else
|
||||
# define BASE_LENGTH BASE64_LENGTH
|
||||
/* Note that increasing this may decrease performance if --ignore-garbage
|
||||
is used, because of the memmove operation below. */
|
||||
# define DEC_BLOCKSIZE (1024*3)
|
||||
|
||||
/* Ensure that BLOCKSIZE is a multiple of 3 and 4. */
|
||||
verify (ENC_BLOCKSIZE % 12 == 0); /* So padding chars only on last block. */
|
||||
verify (DEC_BLOCKSIZE % 12 == 0); /* So complete encoded blocks are used. */
|
||||
|
||||
# define base_encode base64_encode
|
||||
# define base_decode_context base64_decode_context
|
||||
# define base_decode_ctx_init base64_decode_ctx_init
|
||||
# define base_decode_ctx base64_decode_ctx
|
||||
# define isbase isbase64
|
||||
#endif
|
||||
|
||||
static void
|
||||
wrap_write (const char *buffer, size_t len,
|
||||
uintmax_t wrap_column, size_t *current_column, FILE *out)
|
||||
{
|
||||
size_t written;
|
||||
|
||||
if (wrap_column == 0)
|
||||
{
|
||||
/* Simple write. */
|
||||
if (fwrite (buffer, 1, len, stdout) < len)
|
||||
die (EXIT_FAILURE, errno, _("write error"));
|
||||
}
|
||||
else
|
||||
for (written = 0; written < len;)
|
||||
{
|
||||
uintmax_t cols_remaining = wrap_column - *current_column;
|
||||
size_t to_write = MIN (cols_remaining, SIZE_MAX);
|
||||
to_write = MIN (to_write, len - written);
|
||||
|
||||
if (to_write == 0)
|
||||
{
|
||||
if (fputc ('\n', out) == EOF)
|
||||
die (EXIT_FAILURE, errno, _("write error"));
|
||||
*current_column = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fwrite (buffer + written, 1, to_write, stdout) < to_write)
|
||||
die (EXIT_FAILURE, errno, _("write error"));
|
||||
*current_column += to_write;
|
||||
written += to_write;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
do_encode (FILE *in, FILE *out, uintmax_t wrap_column)
|
||||
{
|
||||
size_t current_column = 0;
|
||||
char inbuf[ENC_BLOCKSIZE];
|
||||
char outbuf[BASE_LENGTH (ENC_BLOCKSIZE)];
|
||||
size_t sum;
|
||||
|
||||
do
|
||||
{
|
||||
size_t n;
|
||||
|
||||
sum = 0;
|
||||
do
|
||||
{
|
||||
n = fread (inbuf + sum, 1, ENC_BLOCKSIZE - sum, in);
|
||||
sum += n;
|
||||
}
|
||||
while (!feof (in) && !ferror (in) && sum < ENC_BLOCKSIZE);
|
||||
|
||||
if (sum > 0)
|
||||
{
|
||||
/* Process input one block at a time. Note that ENC_BLOCKSIZE
|
||||
is sized so that no pad chars will appear in output. */
|
||||
base_encode (inbuf, sum, outbuf, BASE_LENGTH (sum));
|
||||
|
||||
wrap_write (outbuf, BASE_LENGTH (sum), wrap_column,
|
||||
¤t_column, out);
|
||||
}
|
||||
}
|
||||
while (!feof (in) && !ferror (in) && sum == ENC_BLOCKSIZE);
|
||||
|
||||
/* When wrapping, terminate last line. */
|
||||
if (wrap_column && current_column > 0 && fputc ('\n', out) == EOF)
|
||||
die (EXIT_FAILURE, errno, _("write error"));
|
||||
|
||||
if (ferror (in))
|
||||
die (EXIT_FAILURE, errno, _("read error"));
|
||||
}
|
||||
|
||||
static void
|
||||
do_decode (FILE *in, FILE *out, bool ignore_garbage)
|
||||
{
|
||||
char inbuf[BASE_LENGTH (DEC_BLOCKSIZE)];
|
||||
char outbuf[DEC_BLOCKSIZE];
|
||||
size_t sum;
|
||||
struct base_decode_context ctx;
|
||||
|
||||
base_decode_ctx_init (&ctx);
|
||||
|
||||
do
|
||||
{
|
||||
bool ok;
|
||||
size_t n;
|
||||
unsigned int k;
|
||||
|
||||
sum = 0;
|
||||
do
|
||||
{
|
||||
n = fread (inbuf + sum, 1, BASE_LENGTH (DEC_BLOCKSIZE) - sum, in);
|
||||
|
||||
if (ignore_garbage)
|
||||
{
|
||||
for (size_t i = 0; n > 0 && i < n;)
|
||||
{
|
||||
if (isbase (inbuf[sum + i]) || inbuf[sum + i] == '=')
|
||||
i++;
|
||||
else
|
||||
memmove (inbuf + sum + i, inbuf + sum + i + 1, --n - i);
|
||||
}
|
||||
}
|
||||
|
||||
sum += n;
|
||||
|
||||
if (ferror (in))
|
||||
die (EXIT_FAILURE, errno, _("read error"));
|
||||
}
|
||||
while (sum < BASE_LENGTH (DEC_BLOCKSIZE) && !feof (in));
|
||||
|
||||
/* The following "loop" is usually iterated just once.
|
||||
However, when it processes the final input buffer, we want
|
||||
to iterate it one additional time, but with an indicator
|
||||
telling it to flush what is in CTX. */
|
||||
for (k = 0; k < 1 + !!feof (in); k++)
|
||||
{
|
||||
if (k == 1 && ctx.i == 0)
|
||||
break;
|
||||
n = DEC_BLOCKSIZE;
|
||||
ok = base_decode_ctx (&ctx, inbuf, (k == 0 ? sum : 0), outbuf, &n);
|
||||
|
||||
if (fwrite (outbuf, 1, n, out) < n)
|
||||
die (EXIT_FAILURE, errno, _("write error"));
|
||||
|
||||
if (!ok)
|
||||
die (EXIT_FAILURE, 0, _("invalid input"));
|
||||
}
|
||||
}
|
||||
while (!feof (in));
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
int opt;
|
||||
FILE *input_fh;
|
||||
const char *infile;
|
||||
|
||||
/* True if --decode has been given and we should decode data. */
|
||||
bool decode = false;
|
||||
/* True if we should ignore non-base-alphabetic characters. */
|
||||
bool ignore_garbage = false;
|
||||
/* Wrap encoded data around the 76:th column, by default. */
|
||||
uintmax_t wrap_column = 76;
|
||||
|
||||
initialize_main (&argc, &argv);
|
||||
set_program_name (argv[0]);
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
while ((opt = getopt_long (argc, argv, "diw:", long_options, NULL)) != -1)
|
||||
switch (opt)
|
||||
{
|
||||
case 'd':
|
||||
decode = true;
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
wrap_column = xdectoumax (optarg, 0, UINTMAX_MAX, "",
|
||||
_("invalid wrap size"), 0);
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
ignore_garbage = true;
|
||||
break;
|
||||
|
||||
case_GETOPT_HELP_CHAR;
|
||||
|
||||
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
|
||||
|
||||
default:
|
||||
usage (EXIT_FAILURE);
|
||||
break;
|
||||
}
|
||||
|
||||
if (argc - optind > 1)
|
||||
{
|
||||
error (0, 0, _("extra operand %s"), quote (argv[optind]));
|
||||
usage (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (optind < argc)
|
||||
infile = argv[optind];
|
||||
else
|
||||
infile = "-";
|
||||
|
||||
if (STREQ (infile, "-"))
|
||||
{
|
||||
xset_binary_mode (STDIN_FILENO, O_BINARY);
|
||||
input_fh = stdin;
|
||||
}
|
||||
else
|
||||
{
|
||||
input_fh = fopen (infile, "rb");
|
||||
if (input_fh == NULL)
|
||||
die (EXIT_FAILURE, errno, "%s", quotef (infile));
|
||||
}
|
||||
|
||||
fadvise (input_fh, FADVISE_SEQUENTIAL);
|
||||
|
||||
if (decode)
|
||||
do_decode (input_fh, stdout, ignore_garbage);
|
||||
else
|
||||
do_encode (input_fh, stdout, wrap_column);
|
||||
|
||||
if (fclose (input_fh) == EOF)
|
||||
{
|
||||
if (STREQ (infile, "-"))
|
||||
die (EXIT_FAILURE, errno, _("closing standard input"));
|
||||
else
|
||||
die (EXIT_FAILURE, errno, "%s", quotef (infile));
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/* basename -- strip directory and suffix from file names
|
||||
Copyright (C) 1990-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
1267
src/basenc.c
Normal file
1267
src/basenc.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/* cat -- concatenate files and print on the standard output.
|
||||
Copyright (C) 1988-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* chcon -- change security context of files
|
||||
Copyright (C) 2005-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* chgrp -- change group ownership of files
|
||||
Copyright (C) 1989-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -295,7 +295,7 @@ main (int argc, char **argv)
|
||||
else
|
||||
{
|
||||
char *group_name = argv[optind++];
|
||||
chopt.group_name = (*group_name ? group_name : NULL);
|
||||
chopt.group_name = (*group_name ? xstrdup (group_name) : NULL);
|
||||
gid = parse_group (group_name);
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ main (int argc, char **argv)
|
||||
(uid_t) -1, gid,
|
||||
(uid_t) -1, (gid_t) -1, &chopt);
|
||||
|
||||
chopt_free (&chopt);
|
||||
IF_LINT (chopt_free (&chopt));
|
||||
|
||||
return ok ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* chmod -- change permission modes of files
|
||||
Copyright (C) 1989-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -566,5 +566,7 @@ main (int argc, char **argv)
|
||||
ok = process_files (argv + optind,
|
||||
FTS_COMFOLLOW | FTS_PHYSICAL | FTS_DEFER_STAT);
|
||||
|
||||
IF_LINT (free (change));
|
||||
|
||||
return ok ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* chown-core.c -- core functions for changing ownership.
|
||||
Copyright (C) 2000-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -67,10 +67,10 @@ chopt_init (struct Chown_option *chopt)
|
||||
}
|
||||
|
||||
extern void
|
||||
chopt_free (struct Chown_option *chopt _GL_UNUSED)
|
||||
chopt_free (struct Chown_option *chopt)
|
||||
{
|
||||
/* Deliberately do not free chopt->user_name or ->group_name.
|
||||
They're not always allocated. */
|
||||
free (chopt->user_name);
|
||||
free (chopt->group_name);
|
||||
}
|
||||
|
||||
/* Convert the numeric group-id, GID, to a string stored in xmalloc'd memory,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* chown-core.h -- types and prototypes shared by chown and chgrp.
|
||||
|
||||
Copyright (C) 2000-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -68,14 +68,14 @@ struct Chown_option
|
||||
void
|
||||
chopt_init (struct Chown_option *);
|
||||
|
||||
void _GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_CONST
|
||||
void
|
||||
chopt_free (struct Chown_option *);
|
||||
|
||||
char *
|
||||
gid_to_name (gid_t);
|
||||
gid_to_name (gid_t) _GL_ATTRIBUTE_MALLOC;
|
||||
|
||||
char * _GL_ATTRIBUTE_PURE
|
||||
uid_to_name (uid_t);
|
||||
char *
|
||||
uid_to_name (uid_t) _GL_ATTRIBUTE_MALLOC;
|
||||
|
||||
bool
|
||||
chown_files (char **files, int bit_flags,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* chown -- change user and group ownership of files
|
||||
Copyright (C) 1989-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -306,7 +306,7 @@ main (int argc, char **argv)
|
||||
empty string so that diagnostics say "ownership :GROUP"
|
||||
rather than "group GROUP". */
|
||||
if (!chopt.user_name && chopt.group_name)
|
||||
chopt.user_name = bad_cast ("");
|
||||
chopt.user_name = xstrdup ("");
|
||||
|
||||
optind++;
|
||||
}
|
||||
@@ -325,7 +325,7 @@ main (int argc, char **argv)
|
||||
uid, gid,
|
||||
required_uid, required_gid, &chopt);
|
||||
|
||||
chopt_free (&chopt);
|
||||
IF_LINT (chopt_free (&chopt));
|
||||
|
||||
return ok ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* chroot -- run command or shell with special root directory
|
||||
Copyright (C) 1995-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
14
src/cksum.c
14
src/cksum.c
@@ -1,5 +1,5 @@
|
||||
/* cksum -- calculate and print POSIX checksums and sizes of files
|
||||
Copyright (C) 1992-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -102,16 +102,10 @@ main (void)
|
||||
|
||||
#else /* !CRCTAB */
|
||||
|
||||
# include <getopt.h>
|
||||
# include "long-options.h"
|
||||
# include "die.h"
|
||||
# include "error.h"
|
||||
|
||||
static struct option const long_options[] =
|
||||
{
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
/* Number of bytes to read at once. */
|
||||
# define BUFLEN (1 << 16)
|
||||
|
||||
@@ -294,10 +288,8 @@ main (int argc, char **argv)
|
||||
so that processes running in parallel do not intersperse their output. */
|
||||
setvbuf (stdout, NULL, _IOLBF, 0);
|
||||
|
||||
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, Version,
|
||||
usage, AUTHORS, (char const *) NULL);
|
||||
if (getopt_long (argc, argv, "", long_options, NULL) != -1)
|
||||
usage (EXIT_FAILURE);
|
||||
parse_gnu_standard_options_only (argc, argv, PROGRAM_NAME, PACKAGE, Version,
|
||||
true, usage, AUTHORS, (char const *) NULL);
|
||||
|
||||
have_read_stdin = false;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* comm -- compare two sorted files line by line.
|
||||
Copyright (C) 1986-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1986-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -493,7 +493,7 @@ main (int argc, char **argv)
|
||||
compare_files (argv + optind);
|
||||
|
||||
if (issued_disorder_warning[0] || issued_disorder_warning[1])
|
||||
return EXIT_FAILURE;
|
||||
die (EXIT_FAILURE, 0, _("input is not in sorted order"));
|
||||
else
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
213
src/copy.c
213
src/copy.c
@@ -1,5 +1,5 @@
|
||||
/* copy.c -- core functions for copying files and directories
|
||||
Copyright (C) 1989-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "ignore-value.h"
|
||||
#include "ioblksize.h"
|
||||
#include "quote.h"
|
||||
#include "renameatu.h"
|
||||
#include "root-uid.h"
|
||||
#include "same.h"
|
||||
#include "savedir.h"
|
||||
@@ -1352,7 +1353,10 @@ preserve_metadata:
|
||||
bool access_changed = false;
|
||||
|
||||
if (!(sb.st_mode & S_IWUSR) && geteuid () != ROOT_UID)
|
||||
access_changed = fchmod_or_lchmod (dest_desc, dst_name, 0600) == 0;
|
||||
{
|
||||
access_changed = fchmod_or_lchmod (dest_desc, dst_name,
|
||||
S_IRUSR | S_IWUSR) == 0;
|
||||
}
|
||||
|
||||
if (!copy_attr (src_name, source_desc, dst_name, dest_desc, x)
|
||||
&& x->require_preserve_xattr)
|
||||
@@ -1375,9 +1379,9 @@ preserve_metadata:
|
||||
if (set_acl (dst_name, dest_desc, x->mode) != 0)
|
||||
return_val = false;
|
||||
}
|
||||
else if (x->explicit_no_preserve_mode)
|
||||
else if (x->explicit_no_preserve_mode && *new_dst)
|
||||
{
|
||||
if (set_acl (dst_name, dest_desc, 0666 & ~cached_umask ()) != 0)
|
||||
if (set_acl (dst_name, dest_desc, MODE_RW_UGO & ~cached_umask ()) != 0)
|
||||
return_val = false;
|
||||
}
|
||||
else if (omitted_permissions)
|
||||
@@ -1623,14 +1627,9 @@ same_file_ok (char const *src_name, struct stat const *src_sb,
|
||||
}
|
||||
}
|
||||
|
||||
/* It's ok to remove a destination symlink. But that works only
|
||||
when creating symbolic links, or when the source and destination
|
||||
are on the same file system and when creating hard links or when
|
||||
unlinking before opening the destination. */
|
||||
if (x->symbolic_link
|
||||
|| ((x->hard_link || x->unlink_dest_before_opening)
|
||||
&& S_ISLNK (dst_sb_link->st_mode)))
|
||||
return dst_sb_link->st_dev == src_sb_link->st_dev;
|
||||
/* It's ok to recreate a destination symlink. */
|
||||
if (x->symbolic_link && S_ISLNK (dst_sb_link->st_mode))
|
||||
return true;
|
||||
|
||||
if (x->dereference == DEREF_NEVER)
|
||||
{
|
||||
@@ -1647,10 +1646,13 @@ same_file_ok (char const *src_name, struct stat const *src_sb,
|
||||
if ( ! SAME_INODE (tmp_src_sb, tmp_dst_sb))
|
||||
return true;
|
||||
|
||||
/* FIXME: shouldn't this be testing whether we're making symlinks? */
|
||||
if (x->hard_link)
|
||||
{
|
||||
*return_now = true;
|
||||
/* It's ok to attempt to hardlink the same file,
|
||||
and return early if not replacing a symlink.
|
||||
Note we need to return early to avoid a later
|
||||
unlink() of DST (when SRC is a symlink). */
|
||||
*return_now = ! S_ISLNK (dst_sb_link->st_mode);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1781,16 +1783,16 @@ static bool
|
||||
create_hard_link (char const *src_name, char const *dst_name,
|
||||
bool replace, bool verbose, bool dereference)
|
||||
{
|
||||
int status = force_linkat (AT_FDCWD, src_name, AT_FDCWD, dst_name,
|
||||
dereference ? AT_SYMLINK_FOLLOW : 0,
|
||||
replace);
|
||||
if (status < 0)
|
||||
int err = force_linkat (AT_FDCWD, src_name, AT_FDCWD, dst_name,
|
||||
dereference ? AT_SYMLINK_FOLLOW : 0,
|
||||
replace, -1);
|
||||
if (0 < err)
|
||||
{
|
||||
error (0, errno, _("cannot create hard link %s to %s"),
|
||||
error (0, err, _("cannot create hard link %s to %s"),
|
||||
quoteaf_n (0, dst_name), quoteaf_n (1, src_name));
|
||||
return false;
|
||||
}
|
||||
if (0 < status && verbose)
|
||||
if (err < 0 && verbose)
|
||||
printf (_("removed %s\n"), quoteaf (dst_name));
|
||||
return true;
|
||||
}
|
||||
@@ -1853,7 +1855,7 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
{
|
||||
struct stat src_sb;
|
||||
struct stat dst_sb;
|
||||
mode_t src_mode;
|
||||
mode_t src_mode IF_LINT ( = 0);
|
||||
mode_t dst_mode IF_LINT ( = 0);
|
||||
mode_t dst_mode_bits;
|
||||
mode_t omitted_permissions;
|
||||
@@ -1865,35 +1867,57 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
bool dest_is_symlink = false;
|
||||
bool have_dst_lstat = false;
|
||||
|
||||
if (x->move_mode && rename_succeeded)
|
||||
*rename_succeeded = false;
|
||||
|
||||
*copy_into_self = false;
|
||||
|
||||
if (XSTAT (x, src_name, &src_sb) != 0)
|
||||
int rename_errno = x->rename_errno;
|
||||
if (x->move_mode)
|
||||
{
|
||||
error (0, errno, _("cannot stat %s"), quoteaf (src_name));
|
||||
return false;
|
||||
if (rename_errno < 0)
|
||||
rename_errno = (renameatu (AT_FDCWD, src_name, AT_FDCWD, dst_name,
|
||||
RENAME_NOREPLACE)
|
||||
? errno : 0);
|
||||
new_dst = rename_errno == 0;
|
||||
if (rename_succeeded)
|
||||
*rename_succeeded = new_dst;
|
||||
}
|
||||
|
||||
src_mode = src_sb.st_mode;
|
||||
|
||||
if (S_ISDIR (src_mode) && !x->recursive)
|
||||
if (rename_errno == 0
|
||||
? !x->last_file
|
||||
: rename_errno != EEXIST || x->interactive != I_ALWAYS_NO)
|
||||
{
|
||||
error (0, 0, ! x->install_mode /* cp */
|
||||
? _("-r not specified; omitting directory %s")
|
||||
: _("omitting directory %s"),
|
||||
quoteaf (src_name));
|
||||
return false;
|
||||
char const *name = rename_errno == 0 ? dst_name : src_name;
|
||||
if (XSTAT (x, name, &src_sb) != 0)
|
||||
{
|
||||
error (0, errno, _("cannot stat %s"), quoteaf (name));
|
||||
return false;
|
||||
}
|
||||
|
||||
src_mode = src_sb.st_mode;
|
||||
|
||||
if (S_ISDIR (src_mode) && !x->recursive)
|
||||
{
|
||||
error (0, 0, ! x->install_mode /* cp */
|
||||
? _("-r not specified; omitting directory %s")
|
||||
: _("omitting directory %s"),
|
||||
quoteaf (src_name));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#ifdef lint
|
||||
else
|
||||
{
|
||||
assert (x->move_mode);
|
||||
memset (&src_sb, 0, sizeof src_sb);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Detect the case in which the same source file appears more than
|
||||
once on the command line and no backup option has been selected.
|
||||
If so, simply warn and don't copy it the second time.
|
||||
This check is enabled only if x->src_info is non-NULL. */
|
||||
if (command_line_arg)
|
||||
if (command_line_arg && x->src_info)
|
||||
{
|
||||
if ( ! S_ISDIR (src_sb.st_mode)
|
||||
if ( ! S_ISDIR (src_mode)
|
||||
&& x->backup_type == no_backups
|
||||
&& seen_file (x->src_info, src_name, &src_sb))
|
||||
{
|
||||
@@ -1909,49 +1933,55 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
|
||||
if (!new_dst)
|
||||
{
|
||||
/* Regular files can be created by writing through symbolic
|
||||
links, but other files cannot. So use stat on the
|
||||
destination when copying a regular file, and lstat otherwise.
|
||||
However, if we intend to unlink or remove the destination
|
||||
first, use lstat, since a copy won't actually be made to the
|
||||
destination in that case. */
|
||||
bool use_stat =
|
||||
((S_ISREG (src_mode)
|
||||
|| (x->copy_as_regular
|
||||
&& ! (S_ISDIR (src_mode) || S_ISLNK (src_mode))))
|
||||
&& ! (x->move_mode || x->symbolic_link || x->hard_link
|
||||
|| x->backup_type != no_backups
|
||||
|| x->unlink_dest_before_opening));
|
||||
if ((use_stat
|
||||
? stat (dst_name, &dst_sb)
|
||||
: lstat (dst_name, &dst_sb))
|
||||
!= 0)
|
||||
if (! (rename_errno == EEXIST && x->interactive == I_ALWAYS_NO))
|
||||
{
|
||||
if (errno != ENOENT)
|
||||
/* Regular files can be created by writing through symbolic
|
||||
links, but other files cannot. So use stat on the
|
||||
destination when copying a regular file, and lstat otherwise.
|
||||
However, if we intend to unlink or remove the destination
|
||||
first, use lstat, since a copy won't actually be made to the
|
||||
destination in that case. */
|
||||
bool use_lstat
|
||||
= ((! S_ISREG (src_mode)
|
||||
&& (! x->copy_as_regular
|
||||
|| S_ISDIR (src_mode) || S_ISLNK (src_mode)))
|
||||
|| x->move_mode || x->symbolic_link || x->hard_link
|
||||
|| x->backup_type != no_backups
|
||||
|| x->unlink_dest_before_opening);
|
||||
int fstatat_flags = use_lstat ? AT_SYMLINK_NOFOLLOW : 0;
|
||||
if (fstatat (AT_FDCWD, dst_name, &dst_sb, fstatat_flags) == 0)
|
||||
{
|
||||
error (0, errno, _("cannot stat %s"), quoteaf (dst_name));
|
||||
return false;
|
||||
have_dst_lstat = use_lstat;
|
||||
rename_errno = EEXIST;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_dst = true;
|
||||
if (errno == ELOOP && x->unlink_dest_after_failed_open)
|
||||
/* leave new_dst=false so we unlink later. */;
|
||||
else if (errno != ENOENT)
|
||||
{
|
||||
error (0, errno, _("cannot stat %s"), quoteaf (dst_name));
|
||||
return false;
|
||||
}
|
||||
else
|
||||
new_dst = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ /* Here, we know that dst_name exists, at least to the point
|
||||
that it is stat'able or lstat'able. */
|
||||
bool return_now;
|
||||
|
||||
have_dst_lstat = !use_stat;
|
||||
if (! same_file_ok (src_name, &src_sb, dst_name, &dst_sb,
|
||||
x, &return_now))
|
||||
if (rename_errno == EEXIST)
|
||||
{
|
||||
bool return_now = false;
|
||||
|
||||
if (x->interactive != I_ALWAYS_NO
|
||||
&& ! same_file_ok (src_name, &src_sb, dst_name, &dst_sb,
|
||||
x, &return_now))
|
||||
{
|
||||
error (0, 0, _("%s and %s are the same file"),
|
||||
quoteaf_n (0, src_name), quoteaf_n (1, dst_name));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!S_ISDIR (src_mode) && x->update)
|
||||
if (x->update && !S_ISDIR (src_mode))
|
||||
{
|
||||
/* When preserving timestamps (but not moving within a file
|
||||
system), don't worry if the destination timestamp is
|
||||
@@ -2121,7 +2151,8 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
return false;
|
||||
}
|
||||
|
||||
char *tmp_backup = backup_file_rename (dst_name, x->backup_type);
|
||||
char *tmp_backup = backup_file_rename (AT_FDCWD, dst_name,
|
||||
x->backup_type);
|
||||
|
||||
/* FIXME: use fts:
|
||||
Using alloca for a file name that may be arbitrarily
|
||||
@@ -2233,7 +2264,9 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
Also, with --recursive, record dev/ino of each command-line directory.
|
||||
We'll use that info to detect this problem: cp -R dir dir. */
|
||||
|
||||
if (x->recursive && S_ISDIR (src_mode))
|
||||
if (rename_errno == 0)
|
||||
earlier_file = NULL;
|
||||
else if (x->recursive && S_ISDIR (src_mode))
|
||||
{
|
||||
if (command_line_arg)
|
||||
earlier_file = remember_copied (dst_name, src_sb.st_ino, src_sb.st_dev);
|
||||
@@ -2319,7 +2352,10 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
|
||||
if (x->move_mode)
|
||||
{
|
||||
if (rename (src_name, dst_name) == 0)
|
||||
if (rename_errno == EEXIST)
|
||||
rename_errno = rename (src_name, dst_name) == 0 ? 0 : errno;
|
||||
|
||||
if (rename_errno == 0)
|
||||
{
|
||||
if (x->verbose)
|
||||
{
|
||||
@@ -2336,7 +2372,7 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
if (rename_succeeded)
|
||||
*rename_succeeded = true;
|
||||
|
||||
if (command_line_arg)
|
||||
if (command_line_arg && !x->last_file)
|
||||
{
|
||||
/* Record destination dev/ino/name, so that if we are asked
|
||||
to overwrite that file again, we can detect it and fail. */
|
||||
@@ -2356,7 +2392,7 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
|
||||
/* This happens when attempting to rename a directory to a
|
||||
subdirectory of itself. */
|
||||
if (errno == EINVAL)
|
||||
if (rename_errno == EINVAL)
|
||||
{
|
||||
/* FIXME: this is a little fragile in that it relies on rename(2)
|
||||
failing with a specific errno value. Expect problems on
|
||||
@@ -2391,7 +2427,7 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
where you'd replace '18' with the integer in parentheses that
|
||||
was output from the perl one-liner above.
|
||||
If necessary, of course, change '/tmp' to some other directory. */
|
||||
if (errno != EXDEV)
|
||||
if (rename_errno != EXDEV)
|
||||
{
|
||||
/* There are many ways this can happen due to a race condition.
|
||||
When something happens between the initial XSTAT and the
|
||||
@@ -2403,7 +2439,7 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
If the permissions on the directory containing the source or
|
||||
destination file are made too restrictive, the rename will
|
||||
fail. Etc. */
|
||||
error (0, errno,
|
||||
error (0, rename_errno,
|
||||
_("cannot move %s to %s"),
|
||||
quoteaf_n (0, src_name), quoteaf_n (1, dst_name));
|
||||
forget_created (src_sb.st_ino, src_sb.st_dev);
|
||||
@@ -2595,11 +2631,12 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
goto un_backup;
|
||||
}
|
||||
}
|
||||
if (force_symlinkat (src_name, AT_FDCWD, dst_name,
|
||||
x->unlink_dest_after_failed_open)
|
||||
< 0)
|
||||
|
||||
int err = force_symlinkat (src_name, AT_FDCWD, dst_name,
|
||||
x->unlink_dest_after_failed_open, -1);
|
||||
if (0 < err)
|
||||
{
|
||||
error (0, errno, _("cannot create symbolic link %s to %s"),
|
||||
error (0, err, _("cannot create symbolic link %s to %s"),
|
||||
quoteaf_n (0, dst_name), quoteaf_n (1, src_name));
|
||||
goto un_backup;
|
||||
}
|
||||
@@ -2622,9 +2659,9 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
&& !(! CAN_HARDLINK_SYMLINKS && S_ISLNK (src_mode)
|
||||
&& x->dereference == DEREF_NEVER))
|
||||
{
|
||||
if (! create_hard_link (src_name, dst_name,
|
||||
x->unlink_dest_after_failed_open,
|
||||
false, dereference))
|
||||
bool replace = (x->unlink_dest_after_failed_open
|
||||
|| x->interactive == I_ASK_USER);
|
||||
if (! create_hard_link (src_name, dst_name, replace, false, dereference))
|
||||
goto un_backup;
|
||||
}
|
||||
else if (S_ISREG (src_mode)
|
||||
@@ -2678,10 +2715,9 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
goto un_backup;
|
||||
}
|
||||
|
||||
int symlink_r = force_symlinkat (src_link_val, AT_FDCWD, dst_name,
|
||||
x->unlink_dest_after_failed_open);
|
||||
int symlink_err = symlink_r < 0 ? errno : 0;
|
||||
if (symlink_err && x->update && !new_dst && S_ISLNK (dst_sb.st_mode)
|
||||
int symlink_err = force_symlinkat (src_link_val, AT_FDCWD, dst_name,
|
||||
x->unlink_dest_after_failed_open, -1);
|
||||
if (0 < symlink_err && x->update && !new_dst && S_ISLNK (dst_sb.st_mode)
|
||||
&& dst_sb.st_size == strlen (src_link_val))
|
||||
{
|
||||
/* See if the destination is already the desired symlink.
|
||||
@@ -2698,7 +2734,7 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
}
|
||||
}
|
||||
free (src_link_val);
|
||||
if (symlink_err)
|
||||
if (0 < symlink_err)
|
||||
{
|
||||
error (0, symlink_err, _("cannot create symbolic link %s"),
|
||||
quoteaf (dst_name));
|
||||
@@ -2834,9 +2870,11 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
if (set_acl (dst_name, -1, x->mode) != 0)
|
||||
return false;
|
||||
}
|
||||
else if (x->explicit_no_preserve_mode)
|
||||
else if (x->explicit_no_preserve_mode && new_dst)
|
||||
{
|
||||
if (set_acl (dst_name, -1, 0777 & ~cached_umask ()) != 0)
|
||||
int default_permissions = S_ISDIR (src_mode) || S_ISSOCK (src_mode)
|
||||
? S_IRWXUGO : MODE_RW_UGO;
|
||||
if (set_acl (dst_name, -1, default_permissions & ~cached_umask ()) != 0)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -2974,6 +3012,7 @@ cp_options_default (struct cp_options *x)
|
||||
#else
|
||||
x->chown_privileges = x->owner_privileges = (geteuid () == ROOT_UID);
|
||||
#endif
|
||||
x->rename_errno = -1;
|
||||
}
|
||||
|
||||
/* Return true if it's OK for chown to fail, where errno is
|
||||
|
||||
11
src/copy.h
11
src/copy.h
@@ -1,5 +1,5 @@
|
||||
/* core functions for copying files and directories
|
||||
Copyright (C) 1989-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -249,6 +249,15 @@ struct cp_options
|
||||
such a symlink) and returns false. */
|
||||
bool open_dangling_dest_symlink;
|
||||
|
||||
/* If true, this is the last filed to be copied. mv uses this to
|
||||
avoid some unnecessary work. */
|
||||
bool last_file;
|
||||
|
||||
/* Zero if the source has already been renamed to the destination; a
|
||||
positive errno number if this failed with the given errno; -1 if
|
||||
no attempt has been made to rename. Always -1, except for mv. */
|
||||
int rename_errno;
|
||||
|
||||
/* Control creation of COW files. */
|
||||
enum Reflink_type reflink_mode;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* arch -- wrapper to uname with the right uname_mode.
|
||||
Copyright (C) 2014-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2014-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* dir -- wrapper to ls with the right ls_mode.
|
||||
Copyright (C) 2014-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2014-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* vdir -- wrapper to ls with the right ls_mode.
|
||||
Copyright (C) 2014-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2014-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2014-2017 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2014-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user