Stefano Lattarini [Fri, 31 Aug 2012 23:46:50 +0000 (01:46 +0200)]
build: rename dist_man1_MANS -> man1_MANS
And list $(man1_MANS) directly in $(EXTRA_DIST) instead.
This is similar to what is done for $(EXTRA_MANS), thus
improving consistency and readability.
* man/local.mk (dist_man1_MANS): Rename ...
(man1_MANS): ... like this.
(EXTRA_DIST): Add its contents.
* cfg.mk (check-x-vs-1): Fix a botched comment.
Stefano Lattarini [Fri, 31 Aug 2012 23:46:49 +0000 (01:46 +0200)]
build: one less unneeded make variable
* man/local.mk (man_aux): This was used only once, so inline its
expansion at its sole point of use ...
(EXTRA_DIST): ... here.
Stefano Lattarini [Fri, 31 Aug 2012 23:46:48 +0000 (01:46 +0200)]
build: simplify and make more portable to non-GNU make
The AC_SUBST'd variable '$(NO_INSTALL_PROGS_DEFAULT)' is only used in
makefile expressions expanding the list of manual pages that are not
built by default (but might need to be when a distribution tarball
is created). Such expressions exploited a feature of make variable
expansion -- namely, $(VAR:%=dir/%.x) -- that, while seemingly quite
portable in practice, is not POSIX-conforming, and could break on
lesser vendor make implementations. So kill two birds with one stone,
by getting rid of the $(NO_INSTALL_PROGS_DEFAULT) intermediate variable
and improving makefile portability in the process.
While at it, we also clean up some other minor naming inconsistency
and useless indirection.
* configure.ac (NO_INSTALL_PROGS_DEFAULT): Don't define or AC_SUBST
anymore; instead ...
(EXTRA_MANS): ... define and AC_SUBST these.
* man/local.mk (extra_man_1): Rename ...
(EXTRA_MANS): ... like this, explicitly making clear it's AC_SUBST'd.
(extra_man_x): It's used only once, no need to define it; just inline
its only expansion where needed.
(EXTRA_DIST): Adjust.
(ALL_MANS): New, union of $(EXTRA_MANS) and $(dist_man1_MANS).
* cfg.mk (check-x-vs-1, sc_option_desc_uppercase): Rely on $(ALL_MANS)
rather than on $(NO_INSTALL_PROGS_DEFAULT) and $(dist_man1_MANS).
Stefano Lattarini [Fri, 31 Aug 2012 23:46:47 +0000 (01:46 +0200)]
build: simplify: get rid of some indirection variables
The code deciding which coreutils programs to build (depending on
defaults, system capabilities, and user requests) is overly complex
and rather confusing. Let's begin simplifying it by removing some
non-strictly-necessary indirection variables.
* configure.ac: Adjust and improve few comments.
(OPTIONAL_BIN_PROGS, OPTIONAL_PKGLIB_PROGS): Rename ...
(bin_PROGRAMS, pkglibexec_PROGRAMS): ... like these, respectively.
Ensure they aren't initialized in all Makefiles (which would lead
to spurious errors), by calling AM_SUBST_NOTMAKE on them.
* src/local.mk: Adjust and improve few comments.
(bin_PROGRAMS, pkglibexec_PROGRAMS): Simply define
to the corresponding '@substitution@'.
Stefano Lattarini [Fri, 31 Aug 2012 23:46:46 +0000 (01:46 +0200)]
maint: update gitignore entries
* src/.gitignore: Here, adding the '.dirstamp' file generated
by the C compilation rules.
Stefano Lattarini [Fri, 31 Aug 2012 23:46:45 +0000 (01:46 +0200)]
maint: fix one stray reference to src/Makefile.am
* build-aux/gen-lists-of-programs.sh: In heading comments here.
Stefano Lattarini [Fri, 31 Aug 2012 23:46:44 +0000 (01:46 +0200)]
maint: fix and simplify maintainer checks
Some of them can be simplified after the previous changes, some
of them have been downright broken by them, and need fixing.
* src/local.mk: Adjust some comments.
(EXTRA_DIST): Avoid SPACE-TAB sequences.
(src/dircolors.h, src/fs.h src/fs-is-local.h): Avoid 8-SPACES
indentation.
(_sc_check-AUTHORS): Move ...
* cfg.mk (sc_check-AUTHORS): ... here (superseding the old rule
with the same name, that was just a recursive invocation to it).
Adjust the paths of the invoked coreutils programs, to account
for the fact that this rule now runs in the top-level build dir,
not in the 'src/' subdir. Other minor cosmetic adjustments.
(ALL_RECURSIVE_TARGETS): Remove 'sc_option_desc_uppercase' and
'sc_man_file_correlation', since they no longer entail any
recursive make invocation.
(sc_option_desc_uppercase): Remove dependency from $(all_programs):
it isn't actually needed.
(check-programs-vs-x): Likewise. Also, fix heading comments to
truly reflect what this check does.
(all-progs-but-lbracket): Strip the 'src/' prefix from each entry
in the list of programs; this avoids a spurious failure in the
'check-programs-vs-x' recipe.
(.PHONY): No need to list targets 'sc_man_file_correlation' and
'sc_option_desc_uppercase': they are automatically declared phony
by 'maint.mk', being recognized as syntax checks.
Stefano Lattarini [Fri, 31 Aug 2012 23:46:43 +0000 (01:46 +0200)]
maint: remove unused target 'install-root'
It was unneeded and broken since the removal of 'su' from GNU
coreutils, in commit v8.17-16-g928dd73 of 2012-06-06, "su: remove
program (util-linux is now the best source for it)".
* Makefile.am (install-root): Remove.
(ALL_RECURSIVE_TARGETS): Update.
Stefano Lattarini [Fri, 31 Aug 2012 23:46:42 +0000 (01:46 +0200)]
maint: improve remake rules for maintainers
This is a follow up on today's commit v8.19-60-g4f2e62b".
* Makefile.am ($(top_srcdir)/m4/cu-progs.m4,
$(srcdir)/src/cu-progs.mk): New, generate these files from the
'build-aux/gen-lists-of-programs.sh', the same way it's done
from the bootstrap script.
* bootstrap.conf (bootstrap_post_import_hook): Add comment about
the necessity to keep those new rules synced with the commands
here. Enhance those commands so to that the generated files are
set read-only.
Stefano Lattarini [Fri, 31 Aug 2012 23:46:41 +0000 (01:46 +0200)]
build: fix generation of manpages for programs not built by default
* src/local.mk (dist-hook): Don't use this to ensure all the
programs, even the ones disabled by default or by the user, are
built (doing so is required to ensure the distributed manpages
are properly built). This would build those programs too late
anyway, causing errors like:
$ make dist
make dist-xz am__post_remove_distdir='@:'
make[1]: Entering directory `~/src/coreutils'
GEN man/arch.1
help2man: can't get '--help' info from man/arch.td/arch
make[1]: *** [man/arch.1] Error 127
make[1]: Leaving directory `~/src/coreutils'
make: *** [dist] Error 2
Instead, ...
* man/local.mk (extra_man_x, extra_man_1): define these ...
($(extra_man_1)): ... and make this depend on $(all_programs).
(EXTRA_DIST): Adjust.
Adjust some comments as well.
Stefano Lattarini [Fri, 31 Aug 2012 23:46:40 +0000 (01:46 +0200)]
build: don't use recursive make to build the 'src' subdirectory
* Makefile.am (SUBDIRS): Remove 'src'. Ensure '.' is listed before
'tests' and 'gnulib-tests'.
(dist-hook): Adjust: we must now tweak the top-level Makefile.in
in $(distdir), not the one in the 'src/' subdir (which is gone).
(include): The '$(top_srcdir)/src/local.mk' file.
* build-aux/gen-lists-of-programs.sh: Adjust the generation of the
automake input fragment.
* tests/Makefile.am (.built-programs): Adjust.
* cfg.mk (all_programs): Remove this convenience rule; it's no
longer needed, now that we can rely directly on the contents of
$(all_programs).
(sc_option_desc_uppercase, check-programs-vs-x:): Adjust lists
of prerequisites accordingly.
(all-progs-but-lbracket): Simplify definition accordingly.
* configure.ac ($OPTIONAL_BIN_PROGS): Adjust definition.
($OPTIONAL_PKGLIB_PROGS): Likewise.
($NO_INSTALL_PROGS_DEFAULT): Tweak definition, for consistency.
(AC_CONFIG_FILES): Remove 'src/Makefile'.
* src/Makefile.am: Rename ...
* src/local.mk: ... like this, with a lot of adjustments. In
addition ...
(all_programs): ... remove this now-unneeded convenience target.
Stefano Lattarini [Fri, 31 Aug 2012 23:46:39 +0000 (01:46 +0200)]
build: refactor how lists of coreutils programs are defined
This is in preparation of future changes. Still, this patch
leaves the build system in a better shape; true, with more
indirections, but also with less convoluted and brittle hacks.
Unfortunately, this commit also makes some rebuild rules
incomplete; that will son be fixed by follow-up patches.
* build-aux/gen-lists-of-programs.sh: New, generates autoconf
and automake input fragments that define "lists" of all coreutils
programs, with further distinctions about how and when these
programs should be built (by default; if the system is capable
enough; only if the user asks for them explicitly). This is
useful to avoid duplicating the definitions of these lists among
several files (at least 'configure.ac' 'src/Makefile.am'); such
duplication had proved a source of inconsistencies and bugs in
the past. And the pre-existing way to avoid such duplication,
as implemented in 'configure.ac' before this patch, was overly
complex and brittle.
* Makefile.am (EXTRA_DIST): Distribute the new script.
* bootstrap.conf (bootstrap_post_import_hook): Run the new script
to generate 'm4/cu-progs.m4' and 'src/cu-progs.mk'.
* .gitignore: Ignore those files.
* configure.ac: Include 'm4/cu-progs.m4', and decidedly simplify
most of the program lists definition and processing accordingly.
* src/Makefile.am: Similarly include 'src/cu-progs.mk', containing
definition of variables $(default__progs), $(no_install__progs)
and $(build_if_possible__progs). Accordingly ...
(no_install__progs, build_if_possible__progs): ... remove.
(EXTRA_DIST): Adjust definition.
Adjust a comment.
Stefano Lattarini [Fri, 31 Aug 2012 23:46:38 +0000 (01:46 +0200)]
maint: add our 'bootstrap_post_import_hook' function
This is in preparation of future changes.
* bootstrap.conf (bootstrap_post_import_hook): New, will be executed
by bootstrap after gnulib-tool but before the autotools.
Move creation of dummy ChangeLog into it.
Eric Blake [Fri, 31 Aug 2012 19:07:54 +0000 (12:07 -0700)]
build: work with new glibc when not optimizing
Starting with glibc 2.15, the system headers refuse to compile
unconditional use of FORTIFY_SOURCE if optimization is disabled
but -Werror is in effect.
* configure.ac (FORTIFY_SOURCE): Make conditional.
Jim Meyering [Fri, 31 Aug 2012 10:52:08 +0000 (12:52 +0200)]
scripts: fix the Signed-off-by:-prohibiting hook to actually work
* scripts/git-hooks/commit-msg: Fix new test: we're searching a
multi-line buffer, so add the //m modifier.
Stefano Lattarini [Fri, 31 Aug 2012 10:29:22 +0000 (12:29 +0200)]
maint: make required gettext version consistent
* bootstrap.conf ($buildreq): Require gettext >= 0.18.1, consistently
with the call to AM_GNU_GETTEXT_VERSION in configure.ac.
Stefano Lattarini [Thu, 30 Aug 2012 16:19:58 +0000 (18:19 +0200)]
maint: get rid of obsolete script 'cvsu'
It was useful only back when coreutils used CVS as its version
control system.
* build-aux/cvsu: Delete.
* Makefile.am (EXTRA_DIST): Remove it.
* cfg.mk: Remove the two exemptions for this removed file.
Stefano Lattarini [Thu, 30 Aug 2012 16:19:57 +0000 (18:19 +0200)]
build: don't use '$<' in non-suffix rules
* src/Makefile.am (fs-def): Here: it's not portable to some non-GNU
make implementations.
Stefano Lattarini [Thu, 30 Aug 2012 16:19:56 +0000 (18:19 +0200)]
maint: more uses of $(ASSORT)
* src/Makefile.am (fs-kernel-magic, fs-magic): Here, instead of
inlining its expansion "LC_ALL=C sort".
Stefano Lattarini [Thu, 30 Aug 2012 16:19:55 +0000 (18:19 +0200)]
maint: remove unused variable in src/Makefile.am
* src/Makefile.am (editpl): This.
Stefano Lattarini [Thu, 30 Aug 2012 16:19:54 +0000 (18:19 +0200)]
build: don't use foo_LDADD if there's no foo program
For example, instead of factoring out the extra linker flags needed
by 'cp', 'mv' ind 'install' into a '$(copy_LDADD)' variable, factor
them out in a '$(copy_ldadd)' variable.
Partly a minor cleanup, partly a preparation for future changes.
* src/Makefile.am (copy_LDADD): Rename ...
(copy_ldadd): ... like this.
(remove_LDADD): Rename ...
(remove_ldadd): ... like this.
All uses adjusted. Some comments updated.
Stefano Lattarini [Thu, 30 Aug 2012 16:19:53 +0000 (18:19 +0200)]
build: some refactorings in cfg.mk
Partly a minor cleanup, partly a preparation for future changes.
* Makefile.am (all_programs): Rename ...
(all-progs-but-lbracket): ... like this, and re-define it to expand
at make time rather than only at recipe time (i.e., using $(shell ...)
instead of `...`).
(check-programs-vs-x): Adjust.
Stefano Lattarini [Thu, 30 Aug 2012 16:19:52 +0000 (18:19 +0200)]
build: move definition of 'all_programs' in cfg.mk
* Makefile.am: Move definition of target 'all_programs' from here ...
* cfg.mk: ... to here, which is the only file where it is used.
Jim Meyering [Fri, 31 Aug 2012 10:08:49 +0000 (12:08 +0200)]
build: reenable just-moved/broken syntax-check rule
* cfg.mk (sc_option_desc_uppercase): Now that this rule lives in cfg.mk,
we must search man/*.1, not "*.1".
Reported by Bernhard Voelker.
Stefano Lattarini [Fri, 31 Aug 2012 07:59:31 +0000 (09:59 +0200)]
maint: fixup: don't try to distribute a now-removed file
* tests/Makefile.am (EXTRA_DIST): Drop 'check.mk', which has been
removed (being merged into 'tests/Makefile.am') by recent changes.
Erik Auerswald [Fri, 31 Aug 2012 09:01:58 +0000 (11:01 +0200)]
doc: escape double quotes in autotools-install --help
* scripts/autotools-install: Fix --help so that we actually print
the double quotes around "make check", in two places.
Jim Meyering [Fri, 31 Aug 2012 08:55:03 +0000 (10:55 +0200)]
scripts: add autotools-install, for those stuck with outdated tools
* scripts/autotools-install: New script, so you can always build
from git-cloned sources, even when they require bleeding edge
m4, autoconf, automake, etc.
Bernhard Voelker [Fri, 31 Aug 2012 08:07:54 +0000 (10:07 +0200)]
build: fix syntax-check rules broken by test-added .sh/pl suffixes
* cfg.mk: We exempt a few test files that would otherwise trigger
false-positive matches in syntax-check rules. The recent change
that added a .sh or .pl suffix to each test script made it so
some of the exclusion regexps would no longer match.
Include the required \.sh suffix in each such regexp, too.
Stefano Lattarini [Thu, 30 Aug 2012 12:13:13 +0000 (14:13 +0200)]
tests: get rid of the 'shell-or-perl' auxiliary script
It's now easier and faster to simply run the perl ans shell test
scripts directly with the appropriate interpreter and options.
* tests/shell-or-perl: Delete.
* tests/Makefile.am (EXTRA_DIST): Remove it.
(SH_LOG_COMPILER): Re-define to invoke the correct shell.
(PL_LOG_COMPILER): Re-define to invoke the correct perl
interpreter ...
(TESTSUITE_PERL_OPTIONS): ... with the correct options.
(XPL_LOG_COMPILER): Use those options instead of inlining
their expansion.
(LOG_COMPILER): Delete, no longer needed.
Stefano Lattarini [Thu, 30 Aug 2012 12:13:12 +0000 (14:13 +0200)]
tests: add .sh and .pl suffixes to shell and perl tests, respectively
Not only this shrinks the size of the generated Makefile (from > 6300
lines to ~3000), but will allow further simplifications in future
changes.
* tests/Makefile.am (TEST_EXTENSIONS): Add '.sh' and '.pl'.
(PL_LOG_COMPILER, SH_LOG_COMPILER): New, still defined simply to
$(LOG_COMPILER) for the time being.
(TESTS, root_tests): Adjust as described.
* All tests: Rename as described.
Stefano Lattarini [Thu, 30 Aug 2012 12:13:11 +0000 (14:13 +0200)]
tests: detect missing perl at configure runtime
* configure.ac (AM_CONDITIONAL): Set the conditional 'HAVE_PERL' to
true if the configure-time checks (as run by gl_PERL) have been able
to find a working perl.
* tests/no-perl: New script, report a diagnostic about "missing perl"
and exit with status 77.
* tests/Makefile.am (EXTRA_DIST): Distribute it.
(TESTSUITE_PERL): New, define to '$(PERL)' if a perl interpreter has
been found at configure time (i.e., if the 'HAVE_PERL' automake
conditional is true), and to '$(srcdir)/no-perl' otherwise.
(LOG_COMPILER): Use $(TESTSUITE_PERL) instead of $(PERL).
(XPL_LOG_COMPILER): Likewise.
* tests/shell-or-perl: Simplify: no need to actually check whether
perl is working.
Stefano Lattarini [Thu, 30 Aug 2012 12:13:10 +0000 (14:13 +0200)]
tests: avoid use of '-T' in shebang line to enable perl taint mode
* tests/rm/fail-eperm: Rename ...
* tests/rm/fail-eperm.xpl: ... like this
* tests/Makefile.am (TESTS): Adjust.
(TEST_EXTENSIONS): New, list '.xpl'.
(XPL_TEST_LOGS): New, run a perl test in tainted mode.
* tests/shell-or-perl: Simplify this script: we no longer need to
parse the shebang line and adjust the flags in the perl invocation
accordingly.
Stefano Lattarini [Thu, 30 Aug 2012 14:58:14 +0000 (16:58 +0200)]
build: require Automake >= 1.11.2
Now that we use AM_TESTS_ENVIRONMENT, we must require
Automake >= 1.11.2.
* configure.ac (AM_INIT_AUTOMAKE): Bump version requirement to 1.11.2.
* bootstrap.conf ($buildreq): Likewise.
Stefano Lattarini [Thu, 30 Aug 2012 12:13:08 +0000 (14:13 +0200)]
tests: prefer AM_TESTS_ENVIRONMENT over TESTS_ENVIRONMENT
The latter should be reserved for user overrides.
* tests/Makefile.am (TESTS_ENVIRONMENT): Rename ...
(AM_TESTS_ENVIRONMENT): ... like this.
Stefano Lattarini [Thu, 30 Aug 2012 12:13:07 +0000 (14:13 +0200)]
tests: merge tests/check.mk into tests/Makefile.am
The separation has become unnecessary after all the ancient
'tests/*/Makefile.am' makefiles have been merged into the
"more-top-level" one 'tests/Makefile.am'.
* tests/check.mk: Merge ...
* tests/Makefile.am: ... in here. Some comments tweaking while
at it.
Stefano Lattarini [Thu, 30 Aug 2012 13:27:47 +0000 (15:27 +0200)]
build: enable the 'subdir-objects' Automake option globally
This is not strictly required now (it will be once we make more
parts of the coreutils build system non-recursive), but enabling
it early helps to ensure that we don't unwittingly introduce any
incompatibility or subtle breakage later.
* configure.ac (AM_INIT_AUTOMAKE): Add 'subdir-objects'.
Stefano Lattarini [Wed, 29 Aug 2012 16:01:02 +0000 (18:01 +0200)]
maint: update gitignore entries
* doc/.gitinore: Here, adding the '.dirstamp' file generated by
the Texinfo rules.
Jim Meyering [Wed, 29 Aug 2012 15:59:48 +0000 (17:59 +0200)]
build: factor out a little more re list of *.texi files
We may well want to switch from checking all *.texi to
checking only version-controlled .texi files, so encapsulate
this concept in one place.
* doc/local.mk (doc_srcdir): Delete. Use this instead:
(texi_files): Define. All usages adjusted.
Stefano Lattarini [Wed, 29 Aug 2012 15:57:45 +0000 (17:57 +0200)]
maint: adjust syntax check 'sc_option_desc_uppercase'
* cfg.mk (sc_option_desc_uppercase): Here, by grafting the 'man/'
prefix to the manpages obtained from $(NO_INSTALL_PROGS_DEFAULT)
and listed as prerequisites for this rule.
Stefano Lattarini [Wed, 29 Aug 2012 15:50:34 +0000 (17:50 +0200)]
maint: adjust syntax check 'check-x-vs-1'
* cfg.mk (check-x-vs-1): Here, by stripping 'man/' prefix from
$(dist_man1_MANS) entries before comparing them with the list of
expected programs.
Stefano Lattarini [Wed, 29 Aug 2012 15:37:35 +0000 (17:37 +0200)]
maint: move man-related syntax checks in cfg.mk
This is more natural, now that the top-level Makefile has access to
all the variables and rules once defined only in 'man/Makefile.am'
* man/local.mk (all_programs, sc_option_desc_uppercase,
sc_man_file_correlation check-x-vs-1, check-programs-vs-x): Move
from here ...
* cfg.mk: ... to here. Adjust some comments in the process.
Stefano Lattarini [Wed, 29 Aug 2012 14:37:24 +0000 (16:37 +0200)]
build: don't use recursive make to build the 'man' subdirectory
* Makefile.am: Include 'man/local.mk'.
(SUBDIRS): Remove 'man'.
* configure.ac ($MAN): Adjust so that each of its entries has a leading
'man/' component.
(AC_CONFIG_FILES): Remove 'man/Makefile'.
* man/Makefile.am: Rename ...
* man/local.mk: ... like this. With further adjustments: each 'foo.1'
target renamed like 'man/foo.1', each '../src/foo.c' dependency as
'src/foo.c', and each '$(srcdir)' usage as '$(srcdir)/man'. Also ...
(mandep): Adjust, removing the leading '../' component.
Several whitespace adjustments while at it.
(ASSORT): Remove, it's already defined in the top-level Makefile.am.
* cfg.mk (sc_option_desc_uppercase, sc_man_file_correlation): Remove
the associated recipes, they are now directly available from the
included 'man/local.mk'. Actually, the other changes in this commit
have made these recipes instable and not completely correct, but that
will be fixed in later changes.
Stefano Lattarini [Wed, 29 Aug 2012 19:31:57 +0000 (21:31 +0200)]
build: rework some recipes in man/Makefile.am, for future changes
This change is merely required to make future changes easier.
In particular, since we are going to merge the contents of
'man/Makefile.am' into the top-level Makefile, we need to avoid
conflicts with the rules and variables in 'dist-check.mk', and
to prepare for changes in the value of the '$*' variable as used
in the recipe of the '.x -> .1' suffix rule.
* man/Makefile.am (t, mapped_name): Delete, inlining their use ...
(.1.x): ... in the recipe of this suffix rule. Other adjustments
to prepare to changes in the value of the '$*' automatic variable.
While at it, made more resilient about unlikely but possible failure.
Adjust and reorder few comments.
Stefano Lattarini [Wed, 29 Aug 2012 14:57:41 +0000 (16:57 +0200)]
build: provide convenience target 'all_programs' also at top-level
This will be mostly useful in future changes.
* Makefile.am (all_programs): New, simply work by delegating to
the same-named target in the 'src/' subdirectory.
* cfg.mk (sc_option_desc_uppercase): Take advantage of it.
(sc_man_file_correlation): Likewise.
Stefano Lattarini [Wed, 29 Aug 2012 14:22:38 +0000 (16:22 +0200)]
build: make a rule less dependent on exact source tree layout
This is mostly a preparatory change in view of future ones.
* man/Makefile.am (.x.1): Use '$(abs_top_builddir)/src' to access
the 'src' directory.
Stefano Lattarini [Wed, 29 Aug 2012 14:13:35 +0000 (16:13 +0200)]
build: rely on VPATH capabilities in man/Makefile
* man/Makefile.am: In all the 'foo.1' targets, no need to depend
explicitly on '$(srcdir)/foo.x': the '.x.1' suffix rule takes care
of that automatically.
Stefano Lattarini [Wed, 29 Aug 2012 13:57:22 +0000 (15:57 +0200)]
maint: typofix: s/it's/its/
* man/Makefile.am: Here.
Stefano Lattarini [Wed, 29 Aug 2012 13:56:47 +0000 (15:56 +0200)]
build: rename common_dep -> mandep in man/Makefile
This is mostly a preparatory refactoring in view of future changes.
* man/Makefile.am (common_dep): Rename ...
(mandep): ... like this.
All usages adjusted.
Stefano Lattarini [Wed, 29 Aug 2012 13:55:54 +0000 (15:55 +0200)]
build: fix a stray usage of uninitialized $(ME)
* man/Makefile.am (sc_option_desc_uppercase): Here.
Stefano Lattarini [Wed, 29 Aug 2012 13:44:05 +0000 (15:44 +0200)]
build: add an explanatory comment
* man/Makefile.am (EXTRA_DIST): Describe portability issues of the
idiom we now use. Reformat the definition a little while at it.
Stefano Lattarini [Wed, 29 Aug 2012 13:18:08 +0000 (15:18 +0200)]
maint: simplify definition of $MAN in configure.ac
* configure.ac: Here, by making less use of 'sed' and 'tr' munging,
and relying on a smarter and simpler shell loop instead.
Stefano Lattarini [Wed, 29 Aug 2012 13:02:19 +0000 (15:02 +0200)]
build: don't define $(SUFFIXES) explicitly
* man/Makefile.am (SUFFIXES): Remove definition: Automake is smart
enough to extract the list of suffixes from the '.x.1' suffix rule
automatically.
Stefano Lattarini [Wed, 29 Aug 2012 12:22:47 +0000 (14:22 +0200)]
build: don't use recursive make to build the 'doc' subdirectory
* doc/Makefile.am: Rename ...
* doc/local.mk: ... like this. With further adjustments ...
(info_TEXINFOS): Prepend 'doc/' to all '*.texi' files listed in
here.
(coreutils_TEXINFOS): Likewise, and rename ...
(doc_coreutils_TEXINFOS): ... like this.
(constants.texi): Rename ...
(doc/constants.texi): ... like this. Adjust the recipe to avoid
spurious errors.
(MAINTAINERCLEANFILES): Adjust, and extend with '+=' rather than
setting it with '='.
(ME): Delete.
(find_upper_case_var): Use '$@', not '$(ME)', in error messages.
* Makefile.am: Include 'doc/local.mk'.
(SUBDIRS): Remove 'doc'.
* configure.ac (AC_CONFIG_FILES): Remove 'doc/Makefile'.
Stefano Lattarini [Wed, 29 Aug 2012 12:15:42 +0000 (14:15 +0200)]
build: use 'check-local' to extend the 'check' target
* doc/Makefile.am (check-local): Here, by making this depend
on 'check-texinfo' ...
(check): ... rather than this. While the old usage worked, it
did so for an implementation detail rather than a documented
behaviour, so relying on that was riskier a "unclean".
Stefano Lattarini [Wed, 29 Aug 2012 12:01:12 +0000 (14:01 +0200)]
build: prefer '$(top_srcdir)/doc' over '$(srcdir)' in doc Makefile
This is just a preparatory refactoring that will become useful in
a future change (in which the doc/Makefile.am makefile will be merged
with the top-level one).
* doc/Makefile.am (doc_srcdir): New, define to '$(top_srcdir)/doc'.
Use it throughout instead of "bare" '$(srcdir)'.
Stefano Lattarini [Wed, 29 Aug 2012 11:55:49 +0000 (13:55 +0200)]
build: add extra *.texi files to coreutils_TEXINFOS, not EXTRA_DIST
* doc/Makefile.am (coreutils_TEXINFO): List them here, instead of ...
(EXTRA_DIST): ... listing them here. This ensures the rebuild rules
will be more faithful.
($(DVIS), $(INFO_DEPS)): No need to depend on $(EXTRA_DIST) now.
Stefano Lattarini [Wed, 29 Aug 2012 11:03:27 +0000 (13:03 +0200)]
maint: slightly improve .gitignore
* .gitignore: Ignore '.deps' only when it's a directory.
Ignore '*.trs' only if they are in a subdirectory of the
'tests/' directory.
Stefano Lattarini [Wed, 29 Aug 2012 10:35:43 +0000 (12:35 +0200)]
build: don't abuse Automake internals (with its 'check-am' rule)
* tests/check.mk (check-am): Remove; obtain the same effect by moving
its dependency '.built-programs' ...
(check_DATA): ... to this variable.
Jim Meyering [Thu, 30 Aug 2012 11:07:10 +0000 (13:07 +0200)]
scripts: git commit message hook: prohibit use of "Signed-off-by:"
* scripts/git-hooks/commit-msg: Reject a commit log message that
contains "Signed-off-by:".
Stefano Lattarini [Wed, 29 Aug 2012 22:35:20 +0000 (00:35 +0200)]
tests: remove useless defn of REPLACE_GETCWD from TESTS_ENVIRONMENT
It's last use had been removed in commit v8.12-3-g3ed91fc of 2011-04-28,
"tests: remove useless test: misc/pwd-unreadable-parent".
* tests/check.mk (TESTS_ENVIRONMENT): Adjust.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Nick Alcock [Wed, 29 Aug 2012 22:02:46 +0000 (23:02 +0100)]
tests: fix misc/sort-exit-early to skip if root
* tests/misc/sort-exit-early: skip_if_root_ as this test
requires an unwritable input and an unreadable output.
Jim Meyering [Wed, 29 Aug 2012 07:32:49 +0000 (09:32 +0200)]
tail,stat: improve support for ZFS
This change enables tail -f to use inotify and lets
stat -f --format=%T report the file system type name, "zfs".
* src/stat.c (human_fstype): Add a case: zfs, 0x2fc12fc1.
* NEWS (Improvements): Mention it.
* THANKS.in: Update.
Reported by Raimonds Miltins in http://bugs.gnu.org/12301.
Jim Meyering [Sun, 26 Aug 2012 20:47:57 +0000 (22:47 +0200)]
build: update gnulib submodule to latest
Jim Meyering [Sun, 26 Aug 2012 11:28:34 +0000 (13:28 +0200)]
maint: stop using @acronym{...} in texinfo sources
* doc/coreutils.texi: Remove all uses of @acronym{...},
per recommendation by Karl Berry.
* doc/perm.texi: Likewise.
* cfg.mk (local-checks-to-skip): Remove exemption, enabling
the @acronym{-prohibiting syntax-check rule.
Jim Meyering [Sun, 26 Aug 2012 11:26:26 +0000 (13:26 +0200)]
tests: don't require @acronym{...} around POSIX
* doc/Makefile.am (check-texinfo): Remove POSIX-checking part.
Nguyễn Thái Ngọc Duy [Sun, 26 Aug 2012 09:57:22 +0000 (16:57 +0700)]
df: allow translators to reorder "1K-blocks" header
* src/df.c (get_header): Mark two "%s-%s" strings for translation
and give translators a hint what each is for.
Ondrej Oprala [Thu, 2 Aug 2012 11:31:50 +0000 (13:31 +0200)]
md5sum, sha*sum: add --tag to output a format indicating the algorithm
The format used is the BSD traditional format which looks like:
MD5 (/dev/null) =
d41d8cd98f00b204e9800998ecf8427e
* NEWS: Add new feature info.
* doc/coreutils.texi (md5sum invocation): Add detailed information
about the new --tag option.
* src/md5sum.c: Add the new --tag option for BSD-style output.
(bsd_split_3): Add ESCAPED_FILENAME parameter.
(print_filename): New function refactored from main().
(filename_unescape): New function refactored from split_3().
* tests/misc/md5sum-bsd: Add tests for the new feature.
Rob Day [Wed, 22 Aug 2012 22:04:19 +0000 (23:04 +0100)]
rm: fix the new --dir (-d) option to work with -i
* src/remove.c (prompt): Hoist the computation of is_empty, since we'll
need it slightly earlier.
Before, this function would arrange to fail with EISDIR when processing
a directory without --recursive (-r). Adjust the condition to exempt
an empty directory when --dir has been specified.
Improve comments.
* tests/rm/d-3: New file, to ensure that rm -d -i dir works.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
* THANKS.in: Update.
Reported by Michael Price in http://bugs.gnu.org/12260
Bernhard Voelker [Wed, 22 Aug 2012 13:04:04 +0000 (15:04 +0200)]
tests: correct print_ver_ arguments and add a rule to enforce this
We use print_ver_ to run "PROG --version" for each program under
test. Some tests have been derived from others, while the
argument(s) to print_ver_ have not been adapted.
Add a new cfg.mk rule to prohibit this.
* cfg.mk (sc_prohibit_test_calls_print_ver_with_irrelevant_argument):
New rule, to prohibit a test script from calling print_env_ for a
program not actually used by that test.
* tests/chown/basic: s/\(print_ver_\) chgrp/\1 chown/
* tests/cp/acl: s/\(print_ver_\) mv/\1 cp/
* tests/cp/capability: s/\(print_ver_\) ls/\1 cp/
* tests/cp/cp-parents: s/(print_ver_\) mv/\1 cp/
* tests/du/bind-mount-dir-cycle: s/(print_ver_\) rm/\1 du/
* tests/misc/wc-parallel: s/(print_ver_\) md5sum/\1 wc/
Ondrej Oprala [Thu, 9 Aug 2012 15:34:09 +0000 (17:34 +0200)]
du: handle bind-mounted directory cycles gracefully
Before this change, a directory cycle induced by a bind mount
would be treated as a fatal error, i.e., probable disk corruption.
However, such cycles are relatively common, and can be detected
efficiently, so now du emits a descriptive warning and arranges
to exit nonzero.
* NEWS (Bug fixes): Mention it.
* src/du.c: Include "mountlist.h".
(di_mnt): New global set.
(di_files): Rename global from di_set, now that there are two.
(fill_mount_table): New function.
(hash_ins): Add DI_SET parameter.
(process_file): Look up each dir dev/ino pair in the new set.
(main): Allocate, initialize, and free the new set.
* tests/du/bind-mount-dir-cycle: Add a test for the fix.
* tests/Makefile.am (TESTS): Add it.
* THANKS.in: Update.
This implements the proposal in http://bugs.gnu.org/11844.
Originally reported in http://bugs.debian.org/563254 by Alan Jenkins
and more recently as http://bugzilla.redhat.com/836557
Improved by: Jim Meyering
Jim Meyering [Mon, 20 Aug 2012 06:26:57 +0000 (08:26 +0200)]
maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
Jim Meyering [Mon, 20 Aug 2012 06:13:02 +0000 (08:13 +0200)]
version 8.19
* NEWS: Record release date.
Paul Eggert [Sat, 18 Aug 2012 16:46:39 +0000 (09:46 -0700)]
tests: port df/no-mtab-status to Solaris
* tests/df/no-mtab-status: Include <mntent.h> in test program, so
that the getmntent hack compilation fails on Solaris, as it
should, since it's not compatible with Solaris. Reported by
Stefano Lattarini in <http://bugs.gnu.org/12225>.
Jim Meyering [Sun, 19 Aug 2012 15:34:04 +0000 (17:34 +0200)]
tests: avoid split/filter test failure on very low-mem system
* tests/split/filter: Use xz -1 when compressing, to minimize
memory usage. Otherwise, xz could fail due to insufficient
virtual memory on a system with very little free memory.
Jim Meyering [Sat, 18 Aug 2012 05:26:30 +0000 (07:26 +0200)]
tests: trigger the sort -u free-memory-read bug
* tests/misc/sort-u-FMR: New file.
* tests/Makefile.am (TESTS): Add it.
* tests/misc/sort: Add the test here, too.
* NEWS (Bug fixes): Mention it.
Jim Meyering [Sat, 18 Aug 2012 05:25:28 +0000 (07:25 +0200)]
tests: wrap the valgrind-requiring assertion in a function
* tests/init.cfg (require_valgrind_): New function...
* tests/misc/sort-stale-thread-mem: ...extracted from here.
Paul Eggert [Fri, 17 Aug 2012 20:26:00 +0000 (13:26 -0700)]
sort: simpler fix for sort -u data-loss bug, and for a FMR bug
This also fixes a free-memory-read (FMR) bug: when fillbuf's realloc
of buf->buf frees the buffer into which saved_line.text points,
the processing of that just-read longer line includes comparison
against the saved line in freed memory.
* src/sort.c (overlap): Remove.
(fillbuf): Do not try to copy saved lines, as that is too risky
in the presence of parallelism, reallocated buffers, etc.
(sort): Invalidate any saved line before sorting a new batch.
Jim Meyering [Wed, 15 Aug 2012 10:30:44 +0000 (12:30 +0200)]
sort: sort --unique (-u) could cause data loss
sort -u could omit one or more lines of expected output.
This bug arose because sort recorded the most recently printed line via
reference, and if you were unlucky, the storage for that line would be
reused (overwritten) as additional input was read into memory. If you
were doubly unlucky, the new value of the "saved" line would not only
match the very next line, but if that next line were also the first in
a series of identical, not-yet-printed lines, then the corrupted "saved"
line value would result in the omission of all matching lines.
* src/sort.c (saved_line): New static/global, renamed and moved from...
(write_unique): ...here. Old name was "saved", which was too generic
for its new role as file-scoped global.
(fillbuf): With --unique, when we're about to read into a buffer that
overlaps the saved "preceding" line (saved_line), copy the line's .text
member to a realloc'd-as-needed temporary buffer and adjust the line's
key-defining members if they're set.
(overlap): New function.
* tests/misc/sort: New tests.
* NEWS (Bug fixes): Mention it.
* THANKS.in: Update.
Bug introduced via commit v8.5-89-g9face83.
Reported by Rasmus Borup Hansen in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/23173/focus=24647
Jim Meyering [Thu, 16 Aug 2012 06:59:27 +0000 (08:59 +0200)]
tests: reverse args in Coreutils.pm-invoked diff, for consistency
* tests/Coreutils.pm (_compare_files): Reverse diff arguments so
that we invoke diff -c $expected $actual, which is consistent with
how init.sh-using tests invoke "compare exp out".
Jim Meyering [Wed, 15 Aug 2012 09:31:24 +0000 (11:31 +0200)]
maint: correct a stale comment in sort.c
* src/sort.c (fillbuf): Fix comment typo. x2nrealloc no longer
doubles the size of its input buffer.
Jim Meyering [Thu, 16 Aug 2012 17:25:40 +0000 (19:25 +0200)]
maint: fix comment grammar to placate make syntax-check
* src/remove.c (rm_fts): s/can not/cannot/
Krzysztof Goj [Sun, 22 Jan 2012 00:39:59 +0000 (01:39 +0100)]
rm: new option --dir (-d) to remove empty directories
Add new option to rm (-d/--dir), which allows removal of
empty directories, while still safely disallowing removal
of non-empty ones.
This improves compatibility with Mac OS X and BSD systems,
which honor the -d option.
* src/remove.c (rm_fts): Remove empty directories when requested.
* src/remove.h (rm_options) [remove_empty_directories]: New member.
* src/rm.c (long_opts, usage, main): Update usage and option parsing.
(rm_option_init): Initialize the new member.
* src/mv.c (rm_option_init): Initialize the new member.
* tests/rm/d-1: New test case - successfully delete empty dir.
* tests/rm/d-2: New test case - refuse to delete nonempty dir.
* tests/Makefile.am (TESTS): Add them.
Bernhard Voelker [Tue, 14 Aug 2012 07:22:13 +0000 (09:22 +0200)]
df: fail when the mount list is required but cannot be read
* src/df.c (main): Add conditions to fail when the mount list cannot
be read: this includes the cases when a file name argument is given
and any of -a, -l, -t or -x is used.
* doc/coreutils.texi: Document the additional error conditions.
* tests/df/no-mtab-status: Add a new test.
* tests/Makefile.am: Reference the new test.
* NEWS: Mention the fix.
Jim Meyering [Sun, 12 Aug 2012 08:07:32 +0000 (10:07 +0200)]
maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
Jim Meyering [Sun, 12 Aug 2012 07:37:42 +0000 (09:37 +0200)]
version 8.18
* NEWS: Record release date.
Pádraig Brady [Wed, 8 Aug 2012 15:38:38 +0000 (16:38 +0100)]
tests: fix validation of local file systems
* tests/init.cfg (require_mount_list_): A new function
to ensure we can read the list of file systems.
(require_local_dir_): Call the above function, as otherwise
the check is invalid.
* tests/df/total-unprocessed: Ensure df can read the
list of mounted file systems so that --local can be honored.
Jim Meyering [Mon, 6 Aug 2012 14:02:39 +0000 (16:02 +0200)]
build: update gnulib submodule to latest
Jim Meyering [Sun, 5 Aug 2012 14:10:09 +0000 (16:10 +0200)]
tests: printf-surprise: avoid unwarranted failure on FreeBSD 9.0
* tests/misc/printf-surprise: A VM size of 10,000KiB was too
little in which to run "env printf ..." on FreeBSD 9.0-p3.
Increase it to 15,000.
Jim Meyering [Sun, 5 Aug 2012 08:05:13 +0000 (10:05 +0200)]
build: avoid sort link failure on Solaris 10
* src/Makefile.am (sort_LDADD): Sort uses euidaccess, which may require
whatever library configure deemed necessary to resolve the eaccess
function, but no one told sort to link with that library.
(sort_LDADD): Add $(LIB_EACCESS).
Bernhard Voelker [Fri, 3 Aug 2012 23:09:22 +0000 (01:09 +0200)]
df: fix exit code and error messages with --total
When the combination of the file system options with given files or
devices does not lead to output, "df --total" would exit successfully
although it should not.
Examples:
$ df --total --type=xfs / # when / is not an XFS file system
$ df --total --local -t nfs DIR # nfs is remote per se ...
$ df --total -t qwerty /dev/sdb5 # typo in file system type
Furthermore, "df --total" would not print the error message "no file
systems processed" when the file argument does not exist or is otherwise
not accessible.
Example:
$ df --total __not_exist__
These 2 bugs are present since --total was added by commit
v6.12-166-gea2887b.
* src/df.c (get_dev): Do not set file_systems_processed to true when
force_fsu is true, i.e. when the row for the "total" line is processed.
(main): Don't print totals unless we've processed a file system.
Also only print the "no FS processed" message if there was no
preceding diagnostic.
* tests/df/total-unprocessed: Add a new test.
* tests/Makefile.am: Reference the new test.
* NEWS: Mention the fix.
Improved-by: Jim Meyering
Jim Meyering [Sat, 4 Aug 2012 09:02:40 +0000 (11:02 +0200)]
truncate: don't leak a file descriptor with --ref=PIPE
* src/truncate.c (main): For a user who makes the mistake of
using a non-seekable file as a reference for the desired length,
truncate would open that file, attempt to seek to its end, but
upon seek failure would neglect to close the file descriptor.
Close the file descriptor even when lseek fails.
In addition, ignore failure to close that reference FD, since as
long as the lseek succeeds, a close failure doesn't matter.
Coverity spotted the potential FD leak.
Improved-by: Pádraig Brady.
Jim Meyering [Thu, 2 Aug 2012 17:12:18 +0000 (19:12 +0200)]
tests: avoid FP ulimit failure with valgrind-wrapped tools
* tests/init.cfg (require_ulimit_): Raise VM limit from 10MiB to
20MiB, to accommodate overhead of a valgrind-wrapped date program.
Also declare this function's local variables "local".
Jim Meyering [Thu, 2 Aug 2012 17:31:36 +0000 (19:31 +0200)]
split: plug nominal leaks
* src/split.c (lines_rr) [IF_LINT]: Plug a harmless leak.
(main) [IF_LINT]: Free a usually-small (~70KB) buffer
just before exit, mainly to take this off the radar of
leak-detecting tools.
Improved-by: Pádraig Brady.
Jim Meyering [Fri, 27 Jul 2012 21:42:05 +0000 (23:42 +0200)]
tail: avoid rare error-path FD leak
* src/tail.c (tail_forever): Close FD to avoid leak after a
failed fstat.
Jim Meyering [Fri, 27 Jul 2012 10:15:32 +0000 (12:15 +0200)]
maint: refresh stale local gnulib patch files
We carry local adjustments for a few gnulib modules via the
patches in gl/. Nearly all of those patches had become stale
due to evolution of the originals in gnulib.
To refresh them, first make sure you have no local changes in gl/
or in the gnulib submodule, then run "make refresh-gnulib-patches".
Jim Meyering [Wed, 25 Jul 2012 16:35:36 +0000 (18:35 +0200)]
tail: avoid misleading diagnostic upon fstat failure
* src/tail.c (check_fspec): Save fstat-induced errno *before*
calling close_fd, not after. Otherwise, the close could well
clobber the global errno, making tail print an invalid diagnostic.
This could happen only with tail -f, and even then, only when
a valid file descriptor were to provoke fstat failure.
Pádraig Brady [Mon, 23 Jul 2012 08:29:57 +0000 (09:29 +0100)]
tests: add a test for a previously fixed output format bug in join
Add a test and NEWS entry for a bug inadvertently fixed in
a refactoring in commit v8.9-32-gd4db0cb
* tests/misc/join (v2-format): Add a new test.
* THANKS.in: Add the reporter.
* NEWS: Mention the old bug.
* cfg.mk (old_NEWS_hash): Update.
Reported-by: Jean-Pierre Tosoni
Pádraig Brady [Sun, 22 Jul 2012 11:59:49 +0000 (12:59 +0100)]
doc: mention gethostid(3) in hostid(1)
* man/hostid.x: Add gethostid(3) to SEE ALSO section.
Addresses http://bugs.gnu.org/12023
Erik Auerswald [Fri, 20 Jul 2012 22:48:17 +0000 (00:48 +0200)]
doc: mention uniq(1) in sort(1) man-page and vice versa
* man/sort.x: Add SEE ALSO section with entry uniq(1).
* man/uniq.x: Add sort(1) to SEE ALSO section.
Jim Meyering [Sat, 21 Jul 2012 10:08:31 +0000 (12:08 +0200)]
maint: stzncpy: restrict pointer parameters
* src/system.h (stzncpy): Add "restrict" attribute to each pointer
parameter and note in the comment that the buffers must not overlap.