The bug has been introduced during column(1) rewrite. The function
read_input() need to skip leading space only temporary to detect empty
lines, but the rest of the code has to use the original buffer (line).
I've tried to fix one of the symptoms by 5c7b67fbbf
(alter), but this solution is unnecessary and too complex.
Changes:
* don't ignore leading space
* remove unnecessary stuff introduced by 5c7b67fbbf
* fix regression test with incorrect separator
Addresses: https://github.com/karelzak/util-linux/issues/575
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1560283
Signed-off-by: Karel Zak <kzak@redhat.com>
Save the top 21 lines of sys-utils/rfkill.c as COPYING.ISC. This is
useful for Linux distributions an integration tools like Buildroot,
to collect detailed legal information for each package.
[kzak@redhat.com: - remove C-comments and rfkill header]
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
Signed-off-by: Karel Zak <kzak@redhat.com>
Warn on --debug; do not fallthrough because
the message is lost in the verbose output.
Coauthored-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: J William Piggott <elseifthen@gmx.com>
* 'rfkill' of git://github.com/kerolasa/lelux-utiliteetit: (57 commits)
rfkill: add systemd-rfkill(8) see also segment
rfkill: check id number refers to a device that exists
rfkill: use back and forward compatible test
rfkill: add bash-completion file
rfkill: inform in syslog when rfkill is invoked
rfkill: use human readable timestamps in event output
rfkill: use libsmartcols output
rfkill: do not ignore read error
rfkill: clarify 'all devices' handling
rfkill: update manual page
rfkill: make programming style to match util-linux project
rfkill: make command to build in util-linux project
rfkill: move files to appropriate locations
add python module
use uapi rfkill.h
version 0.5
fix compiler warning
Add NFC support
version 0.4
Add rfkill type "fm" to the man page.
...
Also remove unnecessary items. Notice that the licence text from COPYING is
moved to top of the command in comment section.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The high-level readline API is crazy to use with signals. Fortunately
the library provides low-level rl_callback_* API. In this case we can
use poll() to wait for input and control all signals, etc.
This patch also a little changes fdisk behavior on CTRL+C and CTRL+D.
The signals does not kill fdisk, but forces fdisk to return to the
main menu, if already in the main menu then exit. If the disk layout
has been modified than ask "Do you really want to exit...".
Signed-off-by: Karel Zak <kzak@redhat.com>
The line was accidentally removed in the reference commit where only the
short option had to go. Rest of the change is indentation.
Reference: 326c5c93b9
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This script requires ncurses to work, and the ncurses provides reset so
there should not be need to keep this script hanging around.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
changed in include/c.h and applied via sed:
sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c")
sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c")
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Consolidate --help and --version descriptions. We are
now able to align them to the other options.
We changed include/c.h. The rest of this patch was
generated by sed, plus manually setting the right
alignment numbers. We do not change anything but
white spaces in the --help output.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This patch is trivial and changes nothing, because
we were always using usage(stdout)
Now all our usage() functions look very similar. If wanted we
could auto-generate another big cosmetical patch to remove all
the useless "FILE *out" constants and use printf and puts
rather than their f* friends. Such patch could be automatically
synchronized with the translation project (newlines!) to not
make the translators sick.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Creating and naming options is not done when writing usage().
A contributor may not even read howto-usage-function.txt, but
they should read howto-contribute.txt. So move option naming
and change information there.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
Make a functions heading, similar to the existing options heading.
* include/c.h: define USAGE_FUNCTIONS
* Documentation/boilerplate.c: add USAGE_FUNCTIONS
* sys-utils/hwclock.c add functions header to usage()
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: J William Piggott <elseifthen@gmx.com>
It seems good enough to use the current semantic and check for
"noauto" string rather than evaluate "auto/noauto" as a bit flag.
We use flags for mount options, but in this case (mount --all) it's
overkill to convert all options on all fstab entries to flags just to
be sure that somewhere is no "auto,noauto" obscure setting.
Signed-off-by: Karel Zak <kzak@redhat.com>
Now lsblk uses --list when --sort <column> is specified. This patch
allows to specify --tree to overwrite this default behavior add to
force tree-like output. In this case tree branches are sorted by the
<column>.
$ lsblk --sort SIZE
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda2 8:2 0 200M 0 part /boot
sda1 8:1 0 200M 0 part /boot/efi
sda6 8:6 0 7.8G 0 part [SWAP]
sda5 8:5 0 35.1G 0 part /home/misc
sda4 8:4 0 50G 0 part /
sdb1 8:17 0 74.5G 0 part /home/archive
sdb 8:16 0 74.5G 0 disk
sda3 8:3 0 130.3G 0 part /home
sda 8:0 0 223.6G 0 disk
$ lsblk --sort SIZE --tree
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 74.5G 0 disk
└─sdb1 8:17 0 74.5G 0 part /home/archive
sda 8:0 0 223.6G 0 disk
├─sda2 8:2 0 200M 0 part /boot
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda6 8:6 0 7.8G 0 part [SWAP]
├─sda5 8:5 0 35.1G 0 part /home/misc
├─sda4 8:4 0 50G 0 part /
└─sda3 8:3 0 130.3G 0 part /home
Signed-off-by: Karel Zak <kzak@redhat.com>
source-code-management.txt and README had similar content so combine
them in README.
Change Documentation/source-code-management.txt references to README.
Remove Documentation/source-code-management.txt.
Move IRC Channel information to README
Expand information about git branches and tags in README.
Add workflow to README; written by Karel Zak <kzak@redhat.com>
Signed-off-by: J William Piggott <elseifthen@gmx.com>
This patch does not change any wording or grammar. It
only shuffles the order of things and adds a table of
contents. For example: it moves coding related bullet
points into the Coding Style Chapter; it groups email
related Chapters together, and so fourth.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
March 2017 is gone, it is time to remove this utility as scheduled in
earlier commit, and promised in manual page.
Reference: 3f8478a71c
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Make usage() translations to contain complete option help in single
translation unit. And make -z option example complete.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer
Since many 'struct option' has used zero as NULL make them more readable in
same go by reindenting, and using named argument requirements.
Reference: https://lwn.net/Articles/93577/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Compare functionality was printing nonsense values. There is no knowledge
of anyone using this broken functionality. Instead of deprecating the code
for months, and removing it after few release, it is removed immediately.
Needless to say this is unusual removal.
Reference: http://marc.info/?l=util-linux-ng&m=148396210506652&w=2
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Removal was promised to happen in March 2016 and the time has come to get
rid of this unexpected feature.
Reference: c5b057b342
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The patch has been planned for weeks and now the kernel part is
already in Linus' tree. It's a new feature, but it's probably better
to merge the userspace stuff now (v2.28 rc1) than wait next 6 months
for the next util-linux release.
Signed-off-by: Karel Zak <kzak@redhat.com>
Now it's necessary t use two mount(8) calls to create a read-only
mount:
mount /foo /bar -o bind
mount /bar -o remount,ro,bind
This patch allows to specify "bind,ro" and the remount is done
automatically by libmount by additional mount(2) syscall. It's not
atomic of course.
Signed-off-by: Karel Zak <kzak@redhat.com>
Most distributions probably ship reset from ncurses, which means
util-linux reset(1) is unlikely to be in use anywhere. Assuming the
previous being true it is almost unimaginable anyone one would be using
the alternative script, so remove it and mark the script deprecated.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The last/lastb(1) from sysvinit has been around for about two years,
and the better implementation is already part of releases 2.24 to 2.26.
It should be safe to remove the unused last code from the source tree.
Reference: ce60272039
Signed-off-by: Sami Kerola <sami.kerola@lastminute.com>
We want to remove it in 2 years, March 2017.
See discussion "tailf, really needed?"
http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/10967
[kzak@redhat.com: - move warning to usage()]
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
The sfdisk does not care about compatibility with classic DOS
partitioning, and it does not warn about incompatibility with DOS at
all. It means that --Linux is default and it's unnecessary to use
this option.
It's the same situation like with "--unit S", these options are very
probably often used in scripts, and these all is default now. So for
backward compatibility new sfdisk accepts these options on command
line, but prints "option is deprecated" warning message.
Signed-off-by: Karel Zak <kzak@redhat.com>