Commit Graph

68 Commits

Author SHA1 Message Date
Karel Zak 1007fb6d9c tools: improve checkmans
* ignore .git/
* don't print error messages when error counters are zero
* add new KNOWN_REPEATS[]

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-03-01 13:52:07 +01:00
Ruediger Meier 66b7469960 tools: add segfault detection for checkusage.sh
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-06-29 14:04:29 +02:00
Ruediger Meier 99267518a6 tools: checkusage can dump all command output
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>
2017-06-27 08:25:22 +02:00
Ruediger Meier e8e9267f5d tools: ignore unsafe commands in checkusage.sh
These commands behave unusual with --unknownopt.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-06-27 08:25:10 +02:00
Ruediger Meier 22174021f8 build-sys: fix chown mistake, add checkusage.sh to the dist
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>
2017-06-26 21:00:09 +02:00
Ruediger Meier a3c29314f1 tools: add checkusage.sh
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>
2017-06-26 14:38:24 +02:00
Karel Zak 6f2eb03433 build-sys: fix --disable-all-programs --enable-schedutils
* 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>
2017-02-20 14:17:37 +01:00
Karel Zak 1854d6dfc6 build-sys: add non-widechar.conf
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-02-16 13:47:44 +01:00
Karel Zak e1a0fd98cd build-sys: use sed to substitute
Travis CI:
tools/git-version-gen: 116: tools/git-version-gen: Bad substitution

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-29 14:25:23 +01:00
Ruediger Meier 85004b142a build-sys: fix "remove the g in git describe"
The "g" was not always removed and "-rc*" follow-ups were handled
incorrectly.

So now after last commits we have these versions:

 git describe            -> blkid -V
 --------------------------------------------------------------
 v2.29-rc4               -> 2.29-rc4          (libblkid 2.29.0)
 v2.29-rc4-3-g4c8928d    -> 2.29-rc4-3-4c89   (libblkid 2.29.0)

 v2.29                   -> 2.29              (libblkid 2.29.0)
 v2.29-78-g4c8928d       -> 2.29.78-4c89      (libblkid 2.29.78)

 v2.29.1                 -> 2.29.1            (libblkid 2.29.1)
 v2.29.1-4-g4c8928d      -> 2.29.1.4-4c89     (libblkid 2.29.1)

 v2.29.1-rc2             -> 2.29.1-rc2        (libblkid 2.29.1)
 v2.29.1-rc2-3-g4c8928d  -> 2.29.1-rc2-3-4c89 (libblkid 2.29.1)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-29 10:47:11 +01:00
Ruediger Meier 6ac59b5bd5 build-sys: remove old git fallback from git-version-gen
Just make the script more readable. Nobody is using 10 years old
git.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-29 10:47:11 +01:00
Karel Zak b5a58919a9 tools: make ko-release-gen usable with gpg2
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-01 01:20:06 +02:00
Karel Zak 702b6b5f7f build-sys: add tools/Makemodule.am
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>
2016-05-25 15:59:15 +02:00
Karel Zak 5d25b7814f tools: add script to load .po from translationproject.org
I use it for years, let's keep it in the repository.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-05-25 15:28:42 +02:00
Karel Zak 5ae7ae8adb tools: add missing checkcompletion.sh
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-17 14:34:29 +01:00
Ruediger Meier 51658498c4 build-sys: portable usage of find command
- use dot instead of skipping search-path
 - avoid -perm /a+x
 - avoid -path

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-18 12:53:47 +01:00
Sami Kerola 6e93ae8414 tools: stop checkmans.sh validating libtool builds
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>
2015-08-07 21:34:42 +01:00
Karel Zak d43ec106e4 tools: add hexdump badconv() to noreturn smatch list
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 13:18:40 +02:00
Karel Zak 06df240c92 tools: add err_oom() to smatch no_return_funcs
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 12:41:17 +02:00
Karel Zak 9465221848 tools: add libfdisk docs to kernel.org release generator
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-19 13:43:42 +01:00
J William Piggott b8239769f9 tools: checkmans.sh add stats
Add test results statistics.
Fix-up 'KNOWN_REPEATS'.
Version bump.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-13 11:43:46 -05:00
J William Piggott 7d2ba7ad23 tools: checkmans.sh clean up 'let'
Clean up 'let' issues and loop iteration.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-13 11:43:45 -05:00
J William Piggott 34317b9292 tools: checkman.sh portability lexgrog
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>
2015-01-13 11:43:45 -05:00
J William Piggott d1fd99e8e0 tools: checkman.sh portability
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>
2015-01-13 11:43:45 -05:00
Karel Zak ae2f2f5617 build-sys: add libsmartcols to ko-release-gen script
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-18 15:42:09 +02:00
Karel Zak b56dd06df6 tests: update build tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-18 12:46:04 +02:00
Karel Zak fd0e5ae46e build-sys: add non-libsmartcols.conf
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-18 12:44:37 +02:00
Karel Zak f080cc99c8 build-sys: add disable-all.conf to config-gen
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-27 11:37:18 +02:00
Sami Kerola 22c3c4f936 tools: make config-gen to require build target argument
When argument is not supplied help user by telling what arguments can be
used.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-03-07 11:45:54 +01:00
Karel Zak 65acdc8734 build-sys: remove deprecated-mount/
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-05 13:19:19 +01:00
Sami Kerola 052a6cf285 tools: add usage information to checkconfig.sh
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-02-17 14:04:35 +01:00
Karel Zak 413875b649 build-sys: add --with-smack to config-gen.d
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-12 15:48:42 +01:00
Sami Kerola 0a2c1e8ed7 tools: generate autotools files if missing
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-09-10 12:57:31 +02:00
Sami Kerola eb7069693e tools: make checkmans.sh to find missing manuals
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>
2013-04-09 12:26:48 +02:00
Sami Kerola 12cc556bca tools: add checks to manual page test script
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>
2013-04-09 12:26:44 +02:00
Karel Zak 456857a49a build-sys: add config-gen.d stuff for chsh-chfn
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-13 13:49:05 +01:00
Karel Zak 896da7cd34 build-sys: add devel-non-docs compile profile
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-30 12:47:08 +01:00
Sami Kerola 4cf02b6510 ddate: remove from util-linux
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>
2012-10-15 16:41:49 +02:00
Karel Zak af2e97b56b build-sys: remove static from config-gen.d/{devel,all}.conf
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>
2012-09-11 10:25:55 +02:00
Karel Zak 68f6645a7e tools: cleanup config-gen.d
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-26 20:48:22 +02:00
Karel Zak d2feb47fb1 build-sys: convert mount/ to module, rename to mount-deprecated/
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-26 20:48:22 +02:00
Karel Zak b5c6f48631 tools: add small and stupid script to check HAVE_DECL_
use 'make checkdecl' to run the script

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-13 11:59:29 +02:00
Sami Kerola ea6c96fb0f tools: add checkmans.sh
A script to find whether all manuals has proper groff syntax.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-02 20:29:07 +02:00
Sami Kerola 7e08b7d3ce tools: ko-release: make scripts bourne sh compliant [checkbashisms]
$ 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>
2012-03-30 16:48:13 +02:00
Sami Kerola 8313455161 tools: config-gen: make scripts bourne sh compliant [checkbashisms]
$ 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>
2012-03-30 16:48:13 +02:00
Sami Kerola 8b32e57f29 tools: checkconfig.sh: make scripts bourne sh compliant [checkbashisms]
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>
2012-03-30 16:48:12 +02:00
Karel Zak 916a743891 tools: improve ko-release-* scripts
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-30 13:44:11 +02:00
Dave Reisner 99d618c0eb checkxalloc: nudge regex, fix newfound instances
Using the -w flag with grep actually fought against us here, and hid
some instances where xalloc functions weren't used. Discard it in
favor of an explicit word boundary as a prefix to the function name,
and extend our requirements on the trailing side of the pattern.

This also fixes the few new instances that were overlooked because of
the regex's deficiency.

[kzak@redhat.com: - fix also newfound in findmnt
                  - remove unnecessary checks after xallocs]

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 09:44:40 +01:00
Sami Kerola bb9da58e80 tools: add asprintf to checkxalloc script
Reported-By: Dave Reisner <d@falconindy.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-18 14:28:05 +01:00
Karel Zak 0892d88d1a tools: use gpg-aggent in ko-release-gen
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-02-07 11:30:56 +01:00