pull: five mutually unrelated changes
Subsystems (2)
cover pull: five mutually unrelated changes
Hello,
The 'big' change in this pull request is to drop reset(1) from util-linux. I don't think there is any point of keep this script hanging around. Rest should be pretty straightforward review.
Sorry about forgetting uuidparse(1) bash-completion file when that command was introduced, but on good side when I got around adding the completion I noticed that bash set -u is broken here and there. All instances of the set -u issue should be now fixed.
Both boilerplate.c and ldattach(8) changes are very minor, and hopefully do not need further explaining.
----------------------------------------------------------------
The following changes since commit 8ffa3b651d7e74acba8f1d831b7f68fdb3c66aae:
libfdisk: make fdisk compliant to UEFI/GPT specification on PMBR (2017-07-14 12:48:18 +0200)
are available in the git repository at:
git://github.com/kerolasa/lelux-utiliteetit.git 2017wk28
for you to fetch changes up to abbcec4fc9c8d7fb835b4eafd1bc9d82acbf0056:
bash-completion: make completions to work when bash set -u is in use (2017-07-15 22:05:42 +0100)
----------------------------------------------------------------
Sami Kerola (5):
reset: remove script from the package
ldattach: simplify debugging function when vwarnx(3) is available
docs: add optional option back to struct option
uuidparse: add bash-completion file
bash-completion: make completions to work when bash set -u is in use
Documentation/boilerplate.c | 17 ++++++++-------- Documentation/deprecated.txt | 5 ----- bash-completion/Makemodule.am | 3 +++ bash-completion/blkid | 2 +- bash-completion/fdisk | 2 +- bash-completion/fincore | 2 +- bash-completion/findmnt | 2 +- bash-completion/losetup | 2 +- bash-completion/lsipc | 2 +- bash-completion/lslocks | 2 +- bash-completion/lsmem | 2 +- bash-completion/partx | 2 +- bash-completion/prlimit | 2 +- bash-completion/sfdisk | 2 +- bash-completion/swapon | 2 +- bash-completion/uuidparse | 37 +++++++++++++++++++++++++++++++++++ bash-completion/wdctl | 2 +- bash-completion/zramctl | 2 +- configure.ac | 9 +-------- sys-utils/ldattach.c | 10 +++++++--- term-utils/Makemodule.am | 6 ------ term-utils/reset | 19 ------------------ term-utils/reset.1 | 45 ------------------------------------------- 23 files changed, 71 insertions(+), 108 deletions(-) create mode 100644 bash-completion/uuidparse delete mode 100755 term-utils/reset delete mode 100644 term-utils/reset.1
Signature · 1 line
2.13.3
PATCH 1/5 reset: remove script from the package
This script requires ncurses to work, and the ncurses provides reset so there should not be need to keep this script hanging around.
--- Documentation/deprecated.txt | 5 ----- configure.ac | 8 -------- term-utils/Makemodule.am | 6 ------ term-utils/reset | 19 ------------------- term-utils/reset.1 | 45 -------------------------------------------- 5 files changed, 83 deletions(-) delete mode 100755 term-utils/reset delete mode 100644 term-utils/reset.1
Documentation/deprecated.txt +0 -5
@@ -93,11 +93,6 @@ Why: parallel port printers are probably almost extinct devices ---------------------------- -What: reset -Why: ncurses has better reset(1) - ----------------------------- - The Single UNIX(TM) Specification, Version 2 Copyright (C) 1997 The Open Group
configure.ac +0 -8
@@ -1741,14 +1741,6 @@ UL_BUILD_INIT([rename]) AM_CONDITIONAL([BUILD_RENAME], [test "x$build_rename" = xyes]) -AC_ARG_ENABLE([reset], - AS_HELP_STRING([--enable-reset], [build reset]), - [], [UL_DEFAULT_ENABLE([reset], [no])] -) -UL_BUILD_INIT([reset]) -AM_CONDITIONAL([BUILD_RESET], [test "x$build_reset" = xyes]) - - AC_ARG_ENABLE([vipw], AS_HELP_STRING([--enable-vipw], [build vipw]), [], [UL_DEFAULT_ENABLE([vipw], [no])]
term-utils/Makemodule.am +0 -6
@@ -52,12 +52,6 @@ endif endif -if BUILD_RESET -dist_usrbin_exec_SCRIPTS += term-utils/reset -dist_man_MANS += term-utils/reset.1 -endif - - if BUILD_MESG usrbin_exec_PROGRAMS += mesg dist_man_MANS += term-utils/mesg.1
term-utils/reset deleted +0 -19
@@ -1,19 +0,0 @@ -#!/bin/sh -# This command is deprecated. The utility is in maintenance mode, -# meaning we keep them in source tree for backward compatibility -# only. Do not waste time making this command better, unless the -# fix is about security or other very critical issue. -# -# See Documentation/deprecated.txt for more information. -stty sane -tput clear -tput rmacs -tput rmm -tput rmso -tput rmul -tput rs1 -tput rs2 -tput rs3 -bot=$((${LINES:-$(tput lines)} - 1)) -if test "${bot}" -le "0"; then bot=24; fi -tput csr 0 ${bot}
term-utils/reset.1 deleted +0 -45
45 lines not on this page · raw message
Signature · 1 line
2.13.3
PATCH 2/5 ldattach: simplify debugging function when vwarnx(3) is available
In reply to Sami KerolaThe vwarnx(3) is probably not available in all libc implementations, in such cases use the earlier printout as a fallback.
--- configure.ac | 1 + sys-utils/ldattach.c | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-)
configure.ac +1 -0
@@ -428,6 +428,7 @@ AC_CHECK_FUNCS([ \ sysinfo \ timegm \ usleep \ + vwarnx \ warn \ warnx \ ])
sys-utils/ldattach.c +7 -3
@@ -137,11 +137,15 @@ static void dbg(char *fmt, ...)if (debug ==0 )return ;fflush (NULL ); -fprintf (stderr,"%s: " , program_invocation_short_name);va_start (args, fmt); +#ifdef HAVE_VWARNX +vwarnx (fmt, args); +#else +fprintf (stderr,"%s: " , program_invocation_short_name);vfprintf (stderr, fmt, args); -va_end (args);fprintf (stderr,"\n" ); +#endif +va_end (args);fflush (NULL );return ; }
@@ -252,7 +256,7 @@ static int my_cfsetspeed(struct termios *ts, int speed)static void handler (int s) { -dbg ("got SIG %i -> exiting\n" , s); +dbg ("got SIG %i -> exiting" , s);exit (EXIT_SUCCESS ); }
Signature · 1 line
2.13.3
PATCH 3/5 docs: add optional option back to struct option
In reply to Sami KerolaThe line was accidentally removed in the reference commit where only the short option had to go. Rest of the change is indentation.
Reference: 326c5c93b917a623f346155c8b3438b379d9fd60
--- Documentation/boilerplate.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
Documentation/boilerplate.c +9 -8
@@ -69,14 +69,15 @@ int main(int argc, char **argv) OPT_OPTIONAL /* see howto-man-page.txt about short option */ };static const struct option longopts[] = { - {"no-argument" , no_argument,NULL ,'n' }, - {"required" , required_argument,NULL ,'r' }, - {"extremely-long-long-option" , no_argument,NULL ,'e' }, - {"xyzzy" , no_argument,NULL ,OPT_XYZZY }, - {"long-explanation" , no_argument,NULL ,'l' }, - {"foobar" , no_argument,NULL ,'f' }, - {"version" , no_argument,NULL ,'V' }, - {"help" , no_argument,NULL ,'h' }, + {"no-argument" , no_argument,NULL ,'n' }, + {"optional" , optional_argument,NULL ,OPT_OPTIONAL }, + {"required" , required_argument,NULL ,'r' }, + {"extremely-long-long-option" , no_argument,NULL ,'e' }, + {"xyzzy" , no_argument,NULL ,OPT_XYZZY }, + {"long-explanation" , no_argument,NULL ,'l' }, + {"foobar" , no_argument,NULL ,'f' }, + {"version" , no_argument,NULL ,'V' }, + {"help" , no_argument,NULL ,'h' }, {NULL ,0 ,NULL ,0 } };
Signature · 1 line
2.13.3
PATCH 4/5 uuidparse: add bash-completion file
In reply to Sami Kerola--- bash-completion/Makemodule.am | 3 +++ bash-completion/uuidparse | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 bash-completion/uuidparse
bash-completion/Makemodule.am +3 -0
@@ -183,6 +183,9 @@ endif if BUILD_LIBUUID dist_bashcompletion_DATA += bash-completion/uuidgen endif +if BUILD_UUIDPARSE +dist_bashcompletion_DATA += bash-completion/uuidparse +endif if BUILD_UUIDD dist_bashcompletion_DATA += bash-completion/uuidd endif
bash-completion/uuidparse new file +37 -0
@@ -0,0 +1,37 @@ +_uuidparse_module() +{ + local cur prev OPTS + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + case $prev in + '-o'|'--output') + local prefix realcur OUTPUT + realcur="${cur##*,}" + prefix="${cur%$realcur}" + for WORD in "UUID VARIANT TYPE TIME"; do + if ! [[ $prefix == *"$WORD"* ]]; then + OUTPUT="$WORD ${OUTPUT:-""}" + fi + done + compopt -o nospace + COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) ) + return 0 + ;; + '-h'|'--help'|'-V'|'--version') + return 0 + ;; + esac + OPTS=" + --json + --noheadings + --output + --raw + --help + --version + " + COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) + return 0 + +} +complete -F _uuidparse_module uuidparse
Signature · 1 line
2.13.3
PATCH 5/5 bash-completion: make completions to work when bash set -u is in use
In reply to Sami KerolaUser who want to avoid refering to none-existing variables got earlier the following error.
$ set -u $ findmnt --output <tab>bash: OUTPUT: unbound variable
Here is short explanation of this setting.
$ help set -u Treat unset variables as an error when substituting.
--- bash-completion/blkid | 2 +- bash-completion/fdisk | 2 +- bash-completion/fincore | 2 +- bash-completion/findmnt | 2 +- bash-completion/losetup | 2 +- bash-completion/lsipc | 2 +- bash-completion/lslocks | 2 +- bash-completion/lsmem | 2 +- bash-completion/partx | 2 +- bash-completion/prlimit | 2 +- bash-completion/sfdisk | 2 +- bash-completion/swapon | 2 +- bash-completion/wdctl | 2 +- bash-completion/zramctl | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-)
bash-completion/blkid +1 -1
@@ -59,7 +59,7 @@ _blkid_module() prefix="${cur%$realcur}" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then - OUTPUT="$WORD $OUTPUT" + OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace
bash-completion/fdisk +1 -1
@@ -49,7 +49,7 @@ _fdisk_module() " for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then - OUTPUT="$WORD $OUTPUT" + OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace
bash-completion/fincore +1 -1
@@ -12,7 +12,7 @@ _fincore_module() OUTPUT_ALL='PAGES SIZE FILE RES' for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then - OUTPUT="$WORD $OUTPUT" + OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace
bash-completion/findmnt +1 -1
@@ -55,7 +55,7 @@ _findmnt_module() for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then - OUTPUT="$WORD $OUTPUT" + OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace
bash-completion/losetup +1 -1
@@ -33,7 +33,7 @@ _losetup_module() SIZELIMIT DIO" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then - OUTPUT="$WORD $OUTPUT" + OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace
bash-completion/lsipc +1 -1
@@ -35,7 +35,7 @@ _lsipc_module() " for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then - OUTPUT="$WORD $OUTPUT" + OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace
bash-completion/lslocks +1 -1
@@ -20,7 +20,7 @@ _lslocks_module() OUTPUT_ALL="COMMAND PID TYPE SIZE MODE M START END PATH BLOCKER" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then - OUTPUT="$WORD $OUTPUT" + OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace
bash-completion/lsmem +1 -1
@@ -12,7 +12,7 @@ _lsmem_module() OUTPUT_ALL='RANGE SIZE STATE REMOVABLE BLOCK NODE' for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then - OUTPUT="$WORD $OUTPUT" + OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace
bash-completion/partx +1 -1
@@ -15,7 +15,7 @@ _partx_module() prefix="${cur%$realcur}" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then - OUTPUT="$WORD $OUTPUT" + OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace
bash-completion/prlimit +1 -1
@@ -17,7 +17,7 @@ _prlimit_module() OUTPUT_ALL="DESCRIPTION RESOURCE SOFT HARD UNITS" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then - OUTPUT="$WORD $OUTPUT" + OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace
bash-completion/sfdisk +1 -1
@@ -28,7 +28,7 @@ _sfdisk_module() " for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then - OUTPUT="$WORD $OUTPUT" + OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace
bash-completion/swapon +1 -1
@@ -18,7 +18,7 @@ _swapon_module() OUTPUT_ALL="NAME TYPE SIZE USED PRIO UUID LABEL" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then - OUTPUT="$WORD $OUTPUT" + OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace
bash-completion/wdctl +1 -1
@@ -29,7 +29,7 @@ _wdctl_module() OUTPUT_ALL="FLAG DESCRIPTION STATUS BOOT-STATUS DEVICE" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then - OUTPUT="$WORD $OUTPUT" + OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace
bash-completion/zramctl +1 -1
@@ -18,7 +18,7 @@ _zramctl_module() MIGRATED MOUNTPOINT" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then - OUTPUT="$WORD $OUTPUT" + OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace
Signature · 1 line
2.13.3
Quoted 2 lines · Sami Kerola
The 'big' change in this pull request is to drop reset(1) from util-linux. I don't think there is any point of keep this script hanging around.
Why do you think that. I find it useful when some application corrupts the screen. I realize that reset is a symlink to tset, but I find reset easier to remember/use.
-- Bruce
Quoted 6 lines · Bruce Dubbs
Quoted 2 lines
The 'big' change in this pull request is to drop reset(1) from util-linux. I don't think there is any point of keep this script hanging around.
Why do you think that. I find it useful when some application corrupts the screen. I realize that reset is a symlink to tset, but I find reset easier to remember/use.
The ncurses package contains both binaries tput(1) and reset(1). So this script will not work without ncurses, and the very same package has the binary that obsoletes the script.
Signature · 2 lines
Sami Kerola http://www.iki.fi/kerolasa/
Quoted 11 lines · Sami Kerola
Quoted 6 lines · Bruce Dubbs
Quoted 2 lines
The 'big' change in this pull request is to drop reset(1) from util-linux. I don't think there is any point of keep this script hanging around.
Why do you think that. I find it useful when some application corrupts the screen. I realize that reset is a symlink to tset, but I find reset easier to remember/use.
The ncurses package contains both binaries tput(1) and reset(1). So this script will not work without ncurses, and the very same package has the binary that obsoletes the script.
Thanks. I agree that duplicate functions should be removed.
-- Bruce
Karel Zak
maintainerQuoted 9 lines · Bruce Dubbs
Quoted 8 lines · Sami Kerola
Quoted 6 lines · Bruce Dubbs
Quoted 2 lines
The 'big' change in this pull request is to drop reset(1) from util-linux. I don't think there is any point of keep this script hanging around.
Why do you think that. I find it useful when some application corrupts the screen. I realize that reset is a symlink to tset, but I find reset easier to remember/use.
Quoted 5 lines
Quoted 3 lines
The ncurses package contains both binaries tput(1) and reset(1). So this script will not work without ncurses, and the very same package has the binary that obsoletes the script.
Thanks. I agree that duplicate functions should be removed.
And note that it's already deprecated and disabled by default. You need --enable-reset now. I guess distros use reset(1) from ncurses for really long time.
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com
Quoted 19 lines · Sami Kerola
Documentation/boilerplate.c | 17 ++++++++-------- Documentation/deprecated.txt | 5 ----- bash-completion/Makemodule.am | 3 +++ bash-completion/blkid | 2 +- bash-completion/fdisk | 2 +- bash-completion/fincore | 2 +- bash-completion/findmnt | 2 +- bash-completion/losetup | 2 +- bash-completion/lsipc | 2 +- bash-completion/lslocks | 2 +- bash-completion/lsmem | 2 +- bash-completion/partx | 2 +- bash-completion/prlimit | 2 +- bash-completion/sfdisk | 2 +- bash-completion/swapon | 2 +- bash-completion/uuidparse | 37 +++++++++++++++++++++++++++++++++++ bash-completion/wdctl | 2 +- bash-completion/zramctl | 2 +- configure.ac | 9 +--------
Quoted 8 lines
sys-utils/ldattach.c | 10 +++++++--- term-utils/Makemodule.am | 6 ------ term-utils/reset | 19 ------------------ term-utils/reset.1 | 45 ------------------------------------------- 23 files changed, 71 insertions(+), 108 deletions(-) create mode 100644 bash-completion/uuidparse delete mode 100755 term-utils/reset delete mode 100644 term-utils/reset.1
Applied, thanks.
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com