coreutils/README

254 lines
11 KiB
Plaintext
Raw Normal View History

2002-08-04 21:40:26 +08:00
These are the GNU core utilities. This package is the union of
the GNU fileutils, sh-utils, and textutils packages.
Most of these programs have significant advantages over their Unix
counterparts, such as greater speed, additional options, and fewer
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
build: support building all tools in a single binary Add the --enable-single-binary option to the configure file. When enabled, this option builds a single binary file containing the selected tools. Which tool gets executed depends on the value of argv[0] which can be set implicitly through symlinks to the single program. This setup reduces significantly the size of a complete coreutils install, since code from lib/libcoreutils.a is not duplicated in every one of the more than 100 binaries. Runtime overhead is increased due to more dynamic libraries being loaded, and extra initialization being performed for all utils. Also initially a larger binary is loaded from storage, though this is usually alleviated due to caching and lazy mmaping of unused blocks, and in fact the single binary should have better caching characteristics. Comparing the size of the individual versus single binary on x86_64: $ cd src $ size coreutils $ size -t $(../build-aux/gen-lists-of-programs.sh --list-progs | grep -Ev '(coreutils|libstdbuf)') | tail -n1 text data bss dec hex filename 1097416 5388 88432 1191236 122d44 src/coreutils 4901010 124964 163768 5189742 4f306e (TOTALS) Storage requirements are reduced similarly: $ cd src $ du -h coreutils $ du -ch $(../build-aux/gen-lists-of-programs.sh --list-progs | grep -Ev '(coreutils|libstdbuf)') | tail -n1 1.2M coreutils 5.3M total When installing, the makefile will create either symlinks or shebangs based on the --enable-single-binary setting, for each configured tool. In this way, all the tools are still callable individually, but they are all implemented by the same "coreutils" binary installed on the same directory. * .gitignore: Add new generated files. * Makefile.am: New rules to generate build-aux/gen-single-binary.sh and install symlinks. * NEWS: Mention the new feature. * README: Add "coreutils" to the list of utils. * bootstrap.conf: Regenerate src/single-binary.mk * build-aux/gen-lists-of-programs.sh: New --list-progs option. * build-aux/gen-single-binary.sh: Regenerate * configure.ac: New --enable-single-binary option and other variables. Disallow --enable-single-binary=symlinks with --program-prefix et. al. * man/coreutils.x: Manpage hook. * man/local.mk: Add manpage hook and fix dependencies. * src/coreutils.c: Multicall implementation. * src/local.mk: New rules for the single binary option. * tests/local.mk: Add $single_binary_progs to support require_built_() from init.cfg * tests/misc/env.sh: Avoid the use of symlink to echo. * tests/misc/help-version.sh: Add exception for coreutils. * tests/install/basic-1.sh: Really avoid using ginstall strip functionality if there is an issue with the independent strip command. * src/kill.c: Changes to call exit() in main. * src/readlink.c: Likewise. * src/shuf.c: Likewise. * src/timeout.c: Likewise. * src/truncate.c: Likewise.
2014-06-06 10:50:32 +08:00
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
2002-08-04 21:40:26 +08:00
See the file NEWS for a list of major changes in the current release.
If you obtained this file as part of a "git clone", then see the
README-hacking file. If this file came to you as part of a tar archive,
then see the file INSTALL for compilation and installation instructions.
2002-08-04 21:40:26 +08:00
2003-11-05 11:34:09 +08:00
These programs are intended to conform to POSIX (with BSD and other
extensions), like the rest of the GNU system. By default they conform
to older POSIX (1003.2-1992), and therefore support obsolete usages
like "head -10" and "chown owner.group file". This default is
overridden at build-time by the value of <unistd.h>'s _POSIX2_VERSION
macro, and this in turn can be overridden at runtime as described in
the documentation under "Standards conformance".
2002-08-04 21:40:26 +08:00
The ls, dir, and vdir commands are all separate executables instead of
one program that checks argv[0] because people often rename these
programs to things like gls, gnuls, l, etc. Renaming a program
file shouldn't affect how it operates, so that people can get the
behavior they want with whatever name they want.
Special thanks to Paul Eggert, Brian Matthews, Bruce Evans, Karl Berry,
2004-08-11 06:47:08 +08:00
Kaveh Ghazi, and François Pinard for help with debugging and porting
2002-08-04 21:40:26 +08:00
these programs. Many thanks to all of the people who have taken the
time to submit problem reports and fixes. All contributed changes are
attributed in the commit logs.
2002-08-04 21:40:26 +08:00
And thanks to the following people who have provided accounts for
portability testing on many different types of systems: Bob Proulx,
2004-08-11 06:47:08 +08:00
Christian Robert, François Pinard, Greg McGary, Harlan Stenn,
2002-08-04 21:40:26 +08:00
Joel N. Weber, Mark D. Roth, Matt Schalit, Nelson H. F. Beebe,
2004-08-11 06:47:08 +08:00
Réjean Payette, Sam Tardieu.
2002-08-04 21:40:26 +08:00
Thanks to Michael Stone for inflicting test releases of this package
2002-08-04 21:40:26 +08:00
on Debian's unstable distribution, and to all the kind folks who used
that distribution and found and reported bugs.
Note that each man page is now automatically generated from a template
and from the corresponding --help usage message. Patches to the template
files (man/*.x) are welcome. However, the authoritative documentation
is in texinfo form in the doc directory.
*********************************************
On Mac OS X 10.5.1 (Darwin 9.1), test failure
---------------------------------------------
Mac OS X 10.5.1 (Darwin 9.1) provides only partial (and incompatible)
ACL support, so although "./configure && make" succeeds, "make check"
exposes numerous failures. The solution is to turn off ACL support
manually via "./configure --disable-acl". For details, see
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12292/focus=12318>.
2002-08-04 21:40:26 +08:00
2005-09-28 16:21:33 +08:00
*****************************************
Test failure with NLS and gettext <= 0.17
-----------------------------------------
Due to a conflict between libintl.h and gnulib's new xprintf module,
when you configure with NLS support, and with a gettext installation
older than 0.17.1 (not yet released, at the time of this writing),
then some tests fail, at least on NetBSD 1.6. To work around it in
the mean time, you can configure with --disable-nls. For details,
see <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/12015/>.
*********************
2006-08-20 00:52:41 +08:00
Pre-C99 build failure
---------------------
In 2009 we added this requirement:
To build the coreutils from source, you must have a C99-conforming
compiler, due to the use of declarations after non-declaration statements
in several files in src/. There is code in configure to find and, if
possible, enable an appropriate compiler. However, if configure doesn't
find a C99 compiler, it continues nonetheless, and your build will fail.
There used to be a "c99-to-c89.diff" patch you could apply to convert
to code that even an old pre-c99 compiler can handle, but it was too
tedious to maintain, so has been removed.
***********************
HPUX 11.x build failure
-----------------------
A known problem exists when compiling on HPUX on both hppa and ia64
doc,maint: fix use of "i.e." in documentation and comments To align with all other places (and correct grammar), change all upper-case "I.E." to "I.e.". Furthermore, ensure that "i.e." is followed by a comma. Finally, ensure to use a double-space before "I.e.," at the beginning of a sentence. The following was used to change all offending uses (apart from old ChangeLog files): $ git grep -liF 'i.e.' \ | xargs sed -i \ -e 's/I\.E\./I.e./g' \ -e 's/\. \(I\.e\.\)/. \1/g' \ -e 's/\([Ii]\.e\.\)\( \)/\1,\2/g' \ -e 's/\([Ii]\.e\.\)$/\1,/g' * cfg.mk (sc_prohibit_uppercase_id_est): Add new rule. (sc_ensure_double_space_after_dot_before_id_est): Likewise. (sc_ensure_comma_after_id_est): Likewise. (old_NEWS_hash): Refresh hash via "make update-NEWS-hash". * NEWS: Change use of "id est" abbreviation via the above command. * README: Likewise. * README-prereq: Likewise. * doc/coreutils.texi: Likewise. * gl/lib/rand-isaac.c: Likewise. * gl/lib/tempname.c.diff: Likewise. * man/stdbuf.x: Likewise. * src/cat.c: Likewise. * src/copy.c: Likewise. * src/copy.h: Likewise. * src/cp.c: Likewise. * src/cut.c: Likewise. * src/dd.c: Likewise. * src/df.c: Likewise. * src/fiemap.h: Likewise. * src/longlong.h: Likewise. * src/ls.c: Likewise. * src/numfmt.c: Likewise. * src/pr.c: Likewise. * src/shred.c: Likewise. * src/shuf.c: Likewise. * src/split.c: Likewise. * tests/Coreutils.pm: Likewise. * tests/df/df-symlink.sh: Likewise. * tests/df/skip-rootfs.sh: Likewise. * tests/init.sh: Likewise. * tests/ls/color-norm.sh: Likewise. * tests/misc/basename.pl: Likewise. * tests/misc/ls-misc.pl: Likewise. * tests/misc/md5sum-bsd.sh: Likewise. * tests/misc/shred-exact.sh: Likewise. * tests/misc/sort.pl: Likewise. * tests/misc/stdbuf.sh: Likewise. * tests/misc/tac-continue.sh: Likewise. * tests/rm/r-root.sh: Likewise. * tests/tail-2/symlink.sh: Likewise.
2015-02-01 00:39:04 +08:00
in 64-bit mode (i.e., +DD64) on HP-UX 11.0, 11.11, and 11.23. This
is not due to a bug in the package but instead due to a bug in the
system header file which breaks things in 64-bit mode. The default
compilation mode is 32-bit and the software compiles fine using the
default mode. To build this software in 64-bit mode you will need
to fix the system /usr/include/inttypes.h header file. After
correcting that file the software also compiles fine in 64-bit mode.
2005-01-08 17:00:08 +08:00
Here is one possible patch to correct the problem:
--- /usr/include/inttypes.h.orig Thu May 30 01:00:00 1996
+++ /usr/include/inttypes.h Sun Mar 23 00:20:36 2003
@@ -489 +489 @@
-#ifndef __STDC_32_MODE__
+#ifndef __LP64__
2005-01-08 17:00:08 +08:00
************************
OSF/1 4.0d build failure
------------------------
If you use /usr/bin/make on an OSF/1 4.0d system, it will fail due
to the presence of the "[" target. That version of make appears to
treat "[" as some syntax relating to locks. To work around that,
the best solution is to use GNU make. Otherwise, simply remove
all mention of "[$(EXEEXT)" from src/Makefile.
*************************************************
"make check" failure on IRIX 6.5 and Solaris <= 9
-------------------------------------------------
Using the vendor make program to run "make check" fails on these two systems.
If you want to run all of the tests there, use GNU make.
2005-01-08 17:00:08 +08:00
**********************
Running tests as root:
----------------------
If you run the tests as root, note that a few of them create files
and/or run programs as a non-root user, 'nobody' by default.
If you want to use some other non-root username, specify it via
the NON_ROOT_USERNAME environment variable. Depending on the
permissions with which the working directories have been created,
using 'nobody' may fail, because that user won't have the required
read and write access to the build and test directories.
I find that it is best to unpack and build as a non-privileged
user, and then to run the following command as that user in order
to run the privilege-requiring tests:
sudo env PATH="$PATH" NON_ROOT_USERNAME=$USER make -k check-root
If you can run the tests as root, please do so and report any
problems. We get much less test coverage in that mode, and it's
arguably more important that these tools work well when run by
root than when run by less privileged users.
2005-01-08 17:00:08 +08:00
***************
Reporting bugs:
---------------
Send bug reports, questions, comments, etc. to bug-coreutils@gnu.org.
To suggest a patch, see the files README-hacking and HACKING for tips.
If you have a problem with 'sort', try running 'sort --debug', as it
can can often help find and fix problems without having to wait for an
answer to a bug report. If the debug output does not suffice to fix
the problem on your own, please compress and attach it to the rest of
your bug report.
IMPORTANT: if you take the time to report a test failure,
please be sure to include the output of running 'make check'
2006-07-09 17:47:20 +08:00
in verbose mode for each failing test. For example,
if the test that fails is tests/df/df-P.sh, then you would
run this command:
make check TESTS=tests/df/df-P.sh VERBOSE=yes SUBDIRS=. >> log 2>&1
For some tests, you can get even more detail by adding DEBUG=yes.
Then include the contents of the file 'log' in your bug report.
***************************************
There are many tests, but nowhere near as many as we need.
2002-08-04 21:40:26 +08:00
Additions and corrections are very welcome.
If you see a problem that you've already reported, feel free to re-report
it -- it won't bother me to get a reminder. Besides, the more messages I
get regarding a particular problem the sooner it'll be fixed -- usually.
If you sent a complete patch and, after a couple weeks you haven't
2003-06-16 18:51:29 +08:00
received any acknowledgement, please ping us. A complete patch includes
a well-written ChangeLog entry, unified (diff -u format) diffs relative
to the most recent test release (or, better, relative to the latest
sources in the public repository), an explanation for why the patch is
necessary or useful, and if at all possible, enough information to
reproduce whatever problem prompted it. Plus, you'll earn lots of
karma if you include a test case to exercise any bug(s) you fix.
Here are instructions for checking out the latest development sources:
http://savannah.gnu.org/git/?group=coreutils
2002-08-04 21:40:26 +08:00
If your patch adds a new feature, please try to get some sort of consensus
that it is a worthwhile change. One way to do that is to send mail to
coreutils@gnu.org including as much description and justification
as you can. Based on the feedback that generates, you may be able to
convince us that it's worth adding. Please also consult the list of
previously discussed but ultimately rejected feature requests at:
http://www.gnu.org/software/coreutils/rejected_requests.html
2002-08-04 21:40:26 +08:00
WARNING: Now that we use the ./bootstrap script, you should not run
autoreconf manually. Doing that will overwrite essential source files
with older versions, which may make the package unbuildable or introduce
subtle bugs.
2002-08-04 21:40:26 +08:00
WARNING: If you modify files like configure.in, m4/*.m4, aclocal.m4,
or any Makefile.am, then don't be surprised if what gets regenerated no
longer works. To make things work, you'll have to be using appropriate
versions of the tools listed in bootstrap.conf's buildreq string.
2002-08-04 21:40:26 +08:00
All of these programs except 'test' recognize the '--version' option.
When reporting bugs, please include in the subject line both the package
name/version and the name of the program for which you found a problem.
2002-08-04 21:40:26 +08:00
For general documentation on the coding and usage standards
this distribution follows, see the GNU Coding Standards,
http://www.gnu.org/prep/standards_toc.html.
For any copyright year range specified as YYYY-ZZZZ in this package
note that the range specifies every single year in that closed interval.
2002-08-04 21:40:26 +08:00
Mail suggestions and bug reports for these programs to
the address on the last line of --help output.
========================================================================
Copyright (C) 1998-2016 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
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the "GNU Free
Documentation License" file as part of this distribution.