use
$ make CU_DUMP=1 checkusage
for easily reviewing and comparing all output in
/tmp/checkusage--help
/tmp/checkusage--version
/tmp/checkusage--unknownopt
This was a big help when doing all my last usage cleanup.
Actually I used it to dump the original output, edited it
how I would like it, and then changed our programs to match
the wanted output.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Sorry, don't know why I reverted fad561b0.
But for travis we need it only in check_nonroot().
check_root() *can* do chown and the check_dist() is handled
by Makefile.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Just some simple generic tests for our UL commands, regarding
options --help, --version and --unknownopt.
The script looks still a bit weired but could be polished to
be used in tests/. It would be the first time testing at least
"something" for *all* built binaries (currently 109! commands).
For the record here are the current candidates with possible
problems:
$ make checkusage
agetty: --unknownopt, stderr too long: 45
blockdev: --unknownopt, stderr too long: 28
flock: --help, no stdout
flock: --help, non-empty stderr
getopt: --help, returns error
kill: --unknownopt, stderr too short: 1
lsipc: --unknownopt, stderr too long: 77
pg: --unknownopt, stderr too long: 23
renice: --unknownopt, stderr too long: 18
rtcwake: --unknownopt, non-empty stdout
rtcwake: --unknownopt, stderr too long: 21
sulogin: --unknownopt, stderr too long: 17
write: --unknownopt, stderr too long: 12
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* add UL_ENABLE_ALIAS(NAME, MASTERNAME) to initialize $enable_<name>
according to MASTERNAME. Note that we have to use $build_<mastername>,
the $enable_<mastername> is just AC_ARG_ENABLE() stuff only. The
$build_ is evaluated and modified by our UL_...() functions.
* add enable-schedutils.conf to have build-system regression test for
this use-case
Addresses: https://github.com/karelzak/util-linux/issues/415
Signed-off-by: Karel Zak <kzak@redhat.com>
We have "make" targets which depends on tools/check*.sh scripts. It's
ugly to exclude these scripts from the release tar balls (as generated
by "make distcheck").
Signed-off-by: Karel Zak <kzak@redhat.com>
The checkmans.sh tried to validate shared libraries, such as
./.libs/libsmartcols.so.1, causing the check output to a have
lot of pointless garbage.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
checkman.sh depends upon the man-db package:
Add using grog when lexgrog not installed.
/dev/null some troff noise.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
checkman.sh fails if 'git' or 'lib' are
anywhere in the tested file's path:
Change to using relative paths.
Improve the 'find' command call.
checkman.sh depends upon the man-db package:
Remove all instants of the man command and
use troff directly to improve portability.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
Finding missing manuals is loosely based on ideas in man-page-day-1.sh,
wrote by Peter Schiffer.
CC: Peter Schiffer <pschiffe@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This change includes
- better way to detect manual page inclusion
- man -k header test, which uses lexgrog
- repeated word detection
- static declaration to known repeated words
Most of the changes are based on man-page-day-1.sh, that is in use at
RedHat Quality Assurance, and wrote by Peter Schiffer.
CC: Peter Schiffer <pschiffe@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
See RedHat bug for reasons why the ddate is cleaned up. The reference is
where to get the command in future.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=823156
References: https://github.com/bo0ts/ddate
Acked-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
It's impossible to compile static when gcc/ld is forced to
use GNU_RELRO and BIND_NOW for suid binaries (e.g. mount).
Signed-off-by: Karel Zak <kzak@redhat.com>
$ checkbashisms ko-release-gen
possible bashism in ko-release-gen line 31 ('function' is useless):
function die {
possible bashism in ko-release-gen line 36 ('function' is useless):
function add_file {
possible bashism in ko-release-gen line 68 ('function' is useless):
function add_html_dir {
possible bashism in ko-release-gen line 72 (brace expansion):
for fl in $(ls $src/*.{html,css,png}); do
$ checkbashisms ko-release-push
possible bashism in ko-release-push line 29 ('function' is useless):
function die {
possible bashism in ko-release-push line 34 ('function' is useless):
function push_file {
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
$ checkbashisms config-gen
script config-gen does not appear to be a /bin/sh script
possible bashism in config-gen line 27 (export foo=bar should be foo=bar; export foo):
export CFLAGS="$CFLAGS"
$ checkbashisms config-gen-functions.sh
possible bashism in config-gen-functions.sh line 14 ('function' is useless):
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
script checkconfig.sh does not appear to be a /bin/sh script
possible bashism in checkconfig.sh line 14 ('function' is useless):
function die() {
possible bashism in checkconfig.sh line 27 ('((' should be '$(('):
while (( "$#" )); do
Signed-off-by: Sami Kerola <kerolasa@iki.fi>