Karel Zak [Tue, 20 May 2014 13:08:08 +0000 (15:08 +0200)]
lsblk: add --sort <column>
This implementation allow to sort output by arbitrary output column.
Note that output is always converted to human readable strings, but
sort functions in many cases work with original data (stored as
private data to cells by scols_cell_set_userdata()).
Karel Zak [Tue, 20 May 2014 13:04:11 +0000 (15:04 +0200)]
libsmartcols: add scols_sort_table()
* add pointer to column cmp() function [scols_column_set_cmpfunc()]
* allow to store per-cell application private data
(to make it possible to sort tables on data independent on cell
output data) [scols_cell_set_userdata() ...]
* make it possible to access line cell by column
[scols_line_get_column_cell()]
Sort and cmp() stuff based on patches from Shakur Shams Mullick.
Co-Author: Shakur Shams Mullick <shakursmullick@gmail.com> Signed-off-by: Shakur Shams Mullick <shakursmullick@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 20 May 2014 09:44:26 +0000 (11:44 +0200)]
Merge branch '2014wk19' of git://github.com/kerolasa/lelux-utiliteetit
* '2014wk19' of git://github.com/kerolasa/lelux-utiliteetit:
setterm: remove ulcolor and hbcolor duplicates
setterm: add set_blanking() action
setterm: mark some options to be exclusive with each other
setterm: various visual terminal effects are not console specific
setterm: improve error messages
setterm: tell user when options does not effect
setterm: improve perform_sequence() coding style
setterm: correct usage() bright color argument
setterm: make -msglevel 0 to work as is did earlier
setterm: remove devfs and /dev/vcsa0 support
setterm: clean up screendump()
setterm: add init_terminal() to make main() shorter
setterm: add option control structure
setterm: remove usage comment segment
setterm: move show_tabs() and screendump() functions
setterm: use string utils to numeric parsing
setterm: recommend long options with double hyphen
setterm: use getopt_long_only() for option parsing
setterm: clean up includes
Karel Zak [Tue, 20 May 2014 08:23:18 +0000 (10:23 +0200)]
Merge branch 'cramfs-blocksize' of https://github.com/rudimeier/util-linux
* 'cramfs-blocksize' of https://github.com/rudimeier/util-linux:
mkfs.cramfs: fix crash when -b 0
fsck.cramfs: update man page (--extract and --blocksize)
tests: remove test_fsck.cramfs (reverts 6c32ae78)
fsck.cramfs: remove define INCLUDE_FS_TESTS
fsck.cramfs: refactor option -x/--extract
tests: fix fsck.cramfs for systems with certain page sizes
fsck.cramfs: add option --blocksize
fsck.cramfs: rename variable page_size to blksize
fsck.cramfs: ifdef unused outbuffer and page_size
fsck.cramfs: allow smaller superblock sizes
tests, fix cramfs for systems with certain page sizes
Sami Kerola [Sun, 18 May 2014 11:31:16 +0000 (12:31 +0100)]
setterm: make -msglevel 0 to work as is did earlier
Commit 3393c136 caused regression. The klogctl() logging range is 1-8,
but the value 0 is special according to setterm.1 manual page. It turns
on loging, same way as '-msg on' option.
Sami Kerola [Sat, 17 May 2014 19:42:37 +0000 (20:42 +0100)]
setterm: remove usage comment segment
It is enough trouble to keep usage output aligned with getopt() parsing,
manual page, and bash-completion, so get rid of the unnecessary effort
duplication.
Sami Kerola [Mon, 19 May 2014 21:21:14 +0000 (22:21 +0100)]
setterm: recommend long options with double hyphen
While the -version style options will work for next unknown number of
years start moving towards user interface that has way of invoking long
options as most of the other commands.
Sami Kerola [Sat, 17 May 2014 17:52:01 +0000 (18:52 +0100)]
setterm: use getopt_long_only() for option parsing
The getopt_long_only() has advantage of allowing one and two hyphen
versions of options, for example -help and --help. Secondly the getopt
function family from libc can ensure some options requiring arguments,
while other are optional, and some should not accept argument at all.
That makes option parsing more robust.
Unfortunately retiring the old option parsing makes this change greater
than preferred. Assuming not mistakes happen the new code works
functionally exactly as the old did.
Ruediger Meier [Mon, 19 May 2014 10:57:59 +0000 (12:57 +0200)]
fsck.cramfs: refactor option -x/--extract
We want to clean it up to compile it later per default (not only
if defined INCLUDE_FS_TESTS).
- Rename option --destination to --extract.
- DIR argument is now optional because we want to keep the use
case "test uncompression without writing files" ... but we
don't want it always.
- Remove shortopt -x because shortopts with optional args are
evil.
Changing the cmd interface is no compatibility issue here because
all affected options errored out per default in past.
Karel Zak [Fri, 16 May 2014 12:30:05 +0000 (14:30 +0200)]
Merge branch 'tests-mount' of https://github.com/rudimeier/util-linux
* 'tests-mount' of https://github.com/rudimeier/util-linux:
tests: use ts_mount for cramfs
tests: ts_mount knows which fs is expected
tests: ts_mount validates error message
tests, add function ts_mount
Karel Zak [Fri, 16 May 2014 12:27:11 +0000 (14:27 +0200)]
Merge branch 'tests-check-prog' of https://github.com/rudimeier/util-linux
* 'tests-check-prog' of https://github.com/rudimeier/util-linux:
tests: check for mkfs.ext{2,3,4}
tests: consolidate some checks for commands
tests: add function ts_check_prog
Ruediger Meier [Thu, 15 May 2014 11:20:31 +0000 (13:20 +0200)]
tests, add function ts_mount
We want to generalize mounts similar to how we do it already in
minix/mkfs. Currently most of our other checks just fail if
"fs not supported".
Note that the new function checks a bit stronger than before in
minix/mkfs. It respects mount's return value and stderr goes
to $TS_OUTPUT too.
It's a bit ugly that we write to $TS_OUTPUT from inside of the
function. But if the caller would do it then we couldn't
ts_skip and the whole function would be pointless.
Ruediger Meier [Thu, 15 May 2014 09:24:59 +0000 (11:24 +0200)]
tests: consolidate some checks for commands
Use ts_check_prog for mdadm, readelf, file, ntpdate, bc (mdadm was
not always checked so far).
There are some positive side-effects. We are using always $PATH now
instead of randomly hardcoded /usr/bin, /sbin, etc. If we ever want
to change this again, we should do this generically in ts_init.
Karel Zak [Wed, 14 May 2014 12:15:58 +0000 (14:15 +0200)]
Merge branch 'travis-root-checks-v2' of https://github.com/rudimeier/util-linux
* 'travis-root-checks-v2' of https://github.com/rudimeier/util-linux:
travis-ci: enable root checks
travis-ci: minor cleanup and speedup
tests: introduce TS_CMD_UUIDGEN (never use installed one)
tests, don't write TS_DEVICE to stdout anymore
tests: ts_scsi_debug_init must not run in a subshell
tests: cleanup ts_scsi_debug_init
tests: some more tests need loop support
tests: ts_device_init requires loop support
tests: use ts_check_losetup in losetup test
tests: add function ts_check_losetup
tests: ts_device_init remove useless error handling
Karel Zak [Wed, 14 May 2014 11:19:37 +0000 (13:19 +0200)]
Merge branch 'tests-known' of https://github.com/rudimeier/util-linux
* 'tests-known' of https://github.com/rudimeier/util-linux:
tests, script/race is known to fail
tests: script/race would work with variable loop count
tests: ipcs/limits2 is known to fail
tests: fix hexdump for big endian
tests, add missing output for hexdump
tests: fix hexdump, add ts_finalize
tests: fix "KNOWN FAILED" for subtests
Ruediger Meier [Tue, 13 May 2014 11:19:22 +0000 (13:19 +0200)]
tests: fix hexdump for big endian
For now endianess dependent subtests have undefined output on
BE systems until sombody re-checks this and provides expected
output files with .BE suffix.
Ruediger Meier [Sun, 11 May 2014 06:50:28 +0000 (08:50 +0200)]
tests: ts_scsi_debug_init must not run in a subshell
ts_skip and ts_die won't work from subshell. Now we simply use
TS_DEVICE which is globally set in that function.
I've made sure that we never change TS_DEVICE variable after
we've got it. So we could use it again for cleanup on exit in
ts_{finalize,die,skip} functions.