Commit Graph

147 Commits

Author SHA1 Message Date
Bernhard Voelker
c1c92bcb29 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.
2012-08-31 10:16:18 +02:00
Stefano Lattarini
408abf8586 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.
2012-08-30 15:22:00 +02:00
Stefano Lattarini
63bf5a3d42 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.
2012-08-30 15:22:00 +02:00
Stefano Lattarini
b842b88381 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.
2012-08-30 15:22:00 +02:00
Stefano Lattarini
44547edd7c 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.
2012-08-30 15:22:00 +02:00
Stefano Lattarini
b10412567f 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.
2012-08-30 15:22:00 +02:00
Jim Meyering
26db95ca47 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.
2012-08-26 22:47:04 +02:00
Bernhard Voelker
fadf9c5257 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/
2012-08-22 15:45:01 +02:00
Jim Meyering
fe5b5eed94 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2012-08-20 08:26:57 +02:00
Jim Meyering
a07dfa9064 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2012-08-12 10:07:32 +02:00
Pádraig Brady
d75e93cb76 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
2012-07-23 09:54:18 +01:00
Jim Meyering
f173180a96 maint: adjust exemption to track renamed test script
* cfg.mk (exclude_file_name_regexp--sc_file_system): Sync this
exemption regexp to match renamed tests/df/df-P.  This avoids
a "make syntax-check" failure.
2012-07-20 15:10:14 +02:00
Jim Meyering
f79263da4d maint: remove unwarranted uses of strncpy
* src/pinky.c (print_entry): Remove unwarranted uses of strncpy.
Instead, use stpcpy and stpncpy.
* src/who.c (print_user): Likewise.
* cfg.mk: Remove strncpy exemptions.
2012-07-15 13:43:49 +02:00
Jim Meyering
74427c76d7 maint: add syntax-check rule to help avoid misuse of EXIT_FAILURE
* cfg.mk (sc_some_programs_must_avoid_exit_failure): New rule,
to help us avoid using EXIT_FAILURE in programs like sort, ls, nohup,
timeout, env, etc. that use different exit codes in many cases.
2012-07-03 20:14:56 +02:00
Pádraig Brady
8285c2aca0 maint: sc_prohibit_fail_0: update a stale comment
* cfg.mk (sc_prohibit_fail_0): Following on from
commit v8.0-79-g71c2f88, update the comment to match.
2012-07-02 20:41:40 +02:00
Jim Meyering
fdfac0d159 maint: avoid false-positive syntax-check failure due to fail=0 in .texi
* cfg.mk (exclude_file_name_regexp--sc_prohibit_fail_0): Exempt
all .texi files.
2012-06-30 18:29:38 +02:00
Pádraig Brady
4cfca3916d maint: suppress echoing of sc_THANKS_in_duplicates implementation
* cfg.mk (sc_THANKS_in_duplicates): Suppress the echoing of these
commands run during `make syntax-check`
2012-06-22 10:56:25 +01:00
Jim Meyering
e106212d90 maint: migrate strncpy-prohibiting rule to gnulib
* cfg.mk (sc_prohibit_strncpy): Remove rule.
Now it's in gnulib.
2012-06-10 22:02:26 +02:00
Jim Meyering
5b9206c1a8 maint: prohibit use of strncpy
* cfg.mk (sc_prohibit_strncpy): New syntax-check rule.
Exempt pinky.c and who.c, at least for now.
2012-06-10 22:02:26 +02:00
Jim Meyering
7b6ce030cc maint: detect a new type of duplicate in THANKS.in
* cfg.mk (sc_THANKS_in_duplicates): New rule.
2012-06-06 15:10:59 +02:00
Jim Meyering
e438a0e858 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2012-05-10 19:43:00 +02:00
Kevin Lyda
aa078afcf9 maint: fix common spelling errors
These were identified using: https://github.com/lyda/misspell-check
executed like: git ls-files | misspellings -f -

* src/cat.c: Correct a spelling error.
* src/comm.c: Likewise.
* src/expr.c: Likewise.
* src/pr.c: Likewise.
* src/tac.c: Likewise.
* src/test.c: Likewise.
* src/ChangeLog-2005: Likewise.
* src/ChangeLog-2007: Likewise.
* src/NEWS: Likewise.
* src/doc/coreutils.texi: Likewise.
* src/lib/ChangeLog-2007: Likewise.
* src/man/help2man: Likewise.
* src/old/fileutils/ChangeLog-1997: Likewise.
* src/old/fileutils/NEWS: Likewise.
* src/old/sh-utils/ChangeLog.0: Likewise.
* src/old/textutils/ChangeLog: Likewise.
* src/tests/misc/comm: Likewise.
* src/tests/misc/uniq: Likewise.
* src/tests/mv/dir2dir: Likewise.
* src/cfg.mk (old_NEWS_hash): update with `make update-NEWS-hash`
2012-05-08 02:18:39 +01:00
Jim Meyering
e744f4b7b7 maint: prohibit an operator at end of line
Many coding standards, including GNU's, advocate that when
splitting a line near a binary operator, one should put the
operator at the beginning of the continued line, rather than
at the end of the preceding one.  This is for readability:
such operators are relatively important to readability, and
they are more apparent at the beginning of a line than
at the varying-column end of line,
* cfg.mk (sc_prohibit_operator_at_end_of_line): New rule.
Exempt test.c and head.c.
2012-05-02 10:31:53 +02:00
Jim Meyering
e82602833d tests: new syntax-check rule to prohibit use of ... in tests/
* cfg.mk (sc_prohibit_test_backticks): New rule.  Exempt 3 files.
2012-04-04 12:34:22 +02:00
Jim Meyering
911ffaaf30 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2012-03-26 14:15:35 +02:00
Jim Meyering
c1d07237a8 maint: use an optimal-for-coreutils xz compression setting
* cfg.mk: Set XZ_OPT = -8e (determined empirically).
This sacrifices 8 KiB of compressed tarball size for a 32-MiB
decrease in the memory required during decompression.  I.e.,
using -9e would shave off only 8 KiB from the tar.xz file, yet
would force every decompression process to use 32 MiB more memory.
2012-03-07 21:08:26 +01:00
Jim Meyering
3068c84765 maint: make copyright statements more consistent; update gnulib
* cfg.mk (update-copyright-env): Add UPDATE_COPYRIGHT_FORCE=1
to rejoin some split lines, and UPDATE_COPYRIGHT_USE_INTERVALS=2
to make update-copyright use only one year range.
* gnulib: Update to latest, for newer update-copyright script.
2012-01-27 11:33:19 +01:00
Paul Eggert
80bc8651fd maint: quote 'like this' or "like this", not `like this'
* doc/coreutils.texi (Formatting the file names):
coreutils now quotes 'like this'.
* man/help2man:
* src/timeout.c (usage): Quote 'like this' in diagnostics.
* HACKING, Makefile.am, NEWS, README, README-hacking, TODO, cfg.mk:
* doc/Makefile.am, doc/coreutils.texi, m4/jm-macros.m4:
* man/Makefile.am, man/help2man, src/Makefile.am, src/copy.h:
* src/extract-magic, src/ls.c, src/pinky.c, src/pr.c, src/sort.c:
* src/split.c, src/timeout.c, src/who.c, tests/dd/skip-seek-past-file:
* tests/pr/pr-tests: Quote 'like this' in commentary.
* cfg.mk (old_NEWS_hash): Update due to changed old NEWS.
2012-01-22 15:26:38 -08:00
Jim Meyering
d3227eeb90 maint: adjust formatting of certain continued strings
Add a rule to ding any source file that has a continued string
with a word in the first column of the following line.
Those tend to trigger malfunction in tools that try to map an
arbitrary line number to an enclosing function name.  Of course,
very many strings do precisely this, *when they are part of the
usage function*.  So we exempt the body of each usage function.
* src/dircolors.c (main): Separate a long, continued string
into two separately-quoted parts.
* src/od.c (decode_one_format): Likewise.
(decode_one_format, main): Move a space from end of
preceding line to the beginning of the continued line.
* src/tr.c (unquote, string2_extend, validate): Likewise.
* src/seq.c (main): Split in two and use string concatenation.
* src/stat.c (default_format): Use a mix of techniques.
* cfg.mk (sc_prohibit_continued_string_alpha_in_column_1): New rule.
Exempt three files in src: system.h, od.c, printf.c.
2012-01-11 09:27:50 +01:00
Jim Meyering
1df91bd6b9 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2012-01-06 18:29:53 +01:00
Jim Meyering
101a30a2a0 tests: adjust setfacl usage to accommodate Solaris 10
* cfg.mk (sc_prohibit_short_facl_mode_spec): New rule.
* tests/cp/acl: Extend setfacl mode spec to have length 3.
* tests/ls/slink-acl: Likewise.
* tests/mv/acl: Likewise.
Report and analysis by Bruno Haible.
2012-01-05 11:48:35 +01:00
Jim Meyering
5111aa4296 maint: update all copyright year number ranges
Run "make update-copyright".
2012-01-01 10:04:06 +01:00
Eric Blake
20dfc04204 build: update gnulib for syntax-check improvement
Commit 5b3e538 proved useful enough to migrate to gnulib after
enhancing it to be more generic, which in turn pointed out that
commit a2c811db missed an offender.

* gnulib: Update to latest.
* cfg.mk (sc_prohibit_reversed_compare_failure): Delete, now that
gnulib provides it.
* tests/ls/dangle: Fix last offender.
2011-11-29 16:10:40 -07:00
Jim Meyering
5b3e538b7f tests: add a syntax check for last week's global change
Last week I made a global change, commit a2c811db, `tests: use
"compare exp out", not "compare out exp"', but forgot to add a
corresponding syntax check rule.  Without that, it is far too
easy to add a new test or to merge in an old one that would
be non-conforming.  Obviously this is only a heuristic, since
it relies on the expected-output file to have a name that starts
with "exp".
* cfg.mk (sc_prohibit_reversed_compare_failure): Prohibit use of
compare with reversed arguments.
2011-11-27 21:13:18 +01:00
Jim Meyering
ac9581d80c maint: avoid new syntax-check failure due to indentation with TABs
* cfg.mk (tbi_2): Exempt pre-applypatch, since it too is from git.
2011-11-13 10:40:05 +01:00
Jim Meyering
ceae907fb8 maint: adjust the URL that will appear in the generated announcement
* cfg.mk (url_dir_list): Use this http://ftp.gnu.org/gnu/$(PACKAGE)
for the first link listed in the generated announcement.
announce-gen now provides the faster mirror link automatically.
2011-11-12 10:22:55 +01:00
Jim Meyering
2ade806cf5 maint: add git hook scripts
We find it worthwhile to use consistent commit summary prefixes.
To that end, the commit-msg script requires that all commits I make
start with "$P: " (where $P is one of ~100 programs in coreutils)
or one of a few other words, like gnulib tests maint doc build.
It allows more than one word, so e.g., "cat tail head: " would also
be accepted.  Pádraig Brady wrote the initial version, with its
72-column and blank-if-present second line checks.
The pre-commit script is the same as the git-supplied sample script,
modulo a bug fix and the "exec 1>&2" redirection.
* scripts/git-hooks/commit-msg: New file.
* scripts/git-hooks/pre-commit: New file.
* scripts/git-hooks/applypatch-msg: New file.  Verbatim from .sample.
* cfg.mk: Exempt two of the new scripts from the no-leading-TABs check,
since they're nearly verbatim from git, and we want to stay in sync.
Exempt the commit-msg script from the no-"fail=0" check.
2011-10-23 11:44:40 +02:00
Jim Meyering
563bb94068 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2011-10-12 11:57:25 +02:00
Jim Meyering
081e262daf maint: avoid new syntax-check failure
Pulling in the latest gnulib triggered a new false-positive
syntax-check failure.
* cfg.mk (exclude_file_name_regexp--sc_prohibit_always-defined_macros):
Exempt remove.c; its definitions of DT_UNKNOWN, DT_DIR and DT_LNK are
harmless.
2011-09-24 13:17:22 +02:00
Jim Meyering
1888629627 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2011-09-08 17:23:21 +02:00
Jim Meyering
0b27edfe1d maint: prevent accidental future use of the old shell function name
This is especially important for an error-handling shell function
like this that is actually called only rarely.
* cfg.mk (sc_prohibit_framework_failure): New rule, to prevent
use of the old name.
2011-08-08 10:11:48 +02:00
Jim Meyering
e24c711cbc maint: accommodate old-NEWS update
* cfg.mk (old_NEWS_hash): Update, to accommodate 6.12 addition.
Without this change, "make syntax-check" would fail.
2011-07-31 11:23:58 +02:00
Jim Meyering
f8f1c8111e maint: add syntax-check rule to prohibit "."-terminated "SEE ALSO"
* cfg.mk (sc_prohibit_man_see_also_period): Prohibit a period at
the end of the first line after a "SEE ALSO" marker in man/*.x.
With this, we shouldn't have to make any more changes like those
in today's commit, f2dabd68.
2011-07-08 21:55:00 +02:00
Jim Meyering
18839ad9c1 doc: clarify an improvement from coreutils-7.0
* NEWS (7.0 Improvements): Mention the command: "ls -1U".
* cfg.mk (old_NEWS_hash): Update.
2011-06-25 07:59:13 +02:00
Pádraig Brady
24b3c8b160 maint: avoid a false positive syntax check
* cfg.mk (sc_strftime_check): Skip the check when there
is no info to compare against.
Reported by Stefano Lattarini
2011-06-19 11:49:57 +01:00
Jim Meyering
2e580ca741 tests: remove skip_test_ function; use new skip_ instead
* tests/init.cfg (skip_test_): Remove function.
Use skip_ in place of skip_test_ everywhere else.
* cfg.mk (sc_prohibit_skip_): Remove rule.
* tests/**: Use skip_, not skip_test_, everywhere.
2011-06-17 09:17:37 +02:00
Jim Meyering
d7e2365203 maint: enforce cpp indentation policy
* cfg.mk (sc_preprocessor_indentation): New test, from libvirt.
Exempt 3 files from new cppi test.
* gl/lib/randread.c: Adjust cpp indentation to comply.
* src/extent-scan.c (extent_need_sync): Likewise.
2011-05-26 22:10:46 +02:00
Jim Meyering
56a88e9522 maint: accommodate gnulib's newer tight_scope rule
* cfg.mk: Include via "-include", to accommodate new tight-scope rule.
(sc_check-AUTHORS): Change the name of the rule in src/Makefile.am
to _sc_check-AUTHORS, so it doesn't conflict with this one when
this file is included into the sub-make's context.
* src/Makefile.am (_sc_check-AUTHORS): Rename from sc_check-AUTHORS.
* gnulib: Update to latest.
2011-05-25 08:26:14 +02:00
Jim Meyering
cb4a0e31e2 maint: correct typos involving misuse of "a" and "an"
* NEWS: "an misleading"
* src/expr.c: "a integer
* src/ptx.c (find_occurs_in_text): "a end"
* src/shred.c (do_wipefd): "a infinite"
* src/sort.c (SUBTHREAD_LINES_HEURISTIC): "an dual-core"
(compare_random): "an checksum"
* cfg.mk (old_NEWS_hash): Update, since the typo was in old news.
2011-05-19 21:36:33 +02:00
Jim Meyering
76f49e601e maint: add new syntax-check rule to prohibit use of skip_
* cfg.mk (sc_prohibit_skip_): New rule.
* tests/init.cfg (skip_test_): Add a comment.
2011-05-13 18:57:31 +02:00