* [PATCH 2/3] tools: update git-version-gen from gnulib
2017-09-17 18:49 [PATCH 1/3] docs: remove repeated word from mount(8) man page Sami Kerola
@ 2017-09-17 18:49 ` Sami Kerola
2017-09-18 9:07 ` Karel Zak
2017-09-17 18:49 ` [PATCH 3/3] bash-completion: update uuidgen, wipefs, tunelp, setpriv, and hwclock Sami Kerola
2017-09-18 9:05 ` [PATCH 1/3] docs: remove repeated word from mount(8) man page Karel Zak
2 siblings, 1 reply; 8+ messages in thread
From: Sami Kerola @ 2017-09-17 18:49 UTC (permalink / raw)
To: util-linux; +Cc: Sami Kerola
from-gnulib-commit: e277cd7c6cf6435d9d4d380fd6cef0510e3f5afe
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
tools/git-version-gen | 137 +++++++++++++++++++++++++++++++++++++-------------
1 file changed, 102 insertions(+), 35 deletions(-)
diff --git a/tools/git-version-gen b/tools/git-version-gen
index b287cb794..0e254f4be 100755
--- a/tools/git-version-gen
+++ b/tools/git-version-gen
@@ -1,8 +1,8 @@
#!/bin/sh
# Print a version string.
-scriptversion=2011-02-19.19; # UTC
+scriptversion=2017-09-13.06; # UTC
-# Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# Copyright (C) 2007-2017 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,9 +15,9 @@ scriptversion=2011-02-19.19; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
-# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
+# This script is derived from GIT-VERSION-GEN from GIT: https://git-scm.com/.
# It may be run two ways:
# - from a git repository in which the "git describe" command below
# produces useful output (thus requiring at least one signed tag)
@@ -44,8 +44,10 @@ scriptversion=2011-02-19.19; # UTC
# files to pick up a version string change; and leave it stale to
# minimize rebuild time after unrelated changes to configure sources.
#
-# It is probably wise to add these two files to .gitignore, so that you
-# don't accidentally commit either generated file.
+# As with any generated file in a VC'd directory, you should add
+# /.version to .gitignore, so that you don't accidentally commit it.
+# .tarball-version is never generated in a VC'd directory, so needn't
+# be listed there.
#
# Use the following line in your configure.ac, so that $(VERSION) will
# automatically be up-to-date each time configure is run (and note that
@@ -57,24 +59,74 @@ scriptversion=2011-02-19.19; # UTC
# [bug-project@example])
#
# Then use the following lines in your Makefile.am, so that .version
-# will be present for dependencies, and so that .tarball-version will
-# exist in distribution tarballs.
+# will be present for dependencies, and so that .version and
+# .tarball-version will exist in distribution tarballs.
#
+# EXTRA_DIST = $(top_srcdir)/.version
# BUILT_SOURCES = $(top_srcdir)/.version
# $(top_srcdir)/.version:
# echo $(VERSION) > $@-t && mv $@-t $@
# dist-hook:
# echo $(VERSION) > $(distdir)/.tarball-version
-case $# in
- 1|2) ;;
- *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version" \
- '[TAG-NORMALIZATION-SED-SCRIPT]'
- exit 1;;
-esac
-tarball_version_file=$1
-tag_sed_script="${2:-s/x/x/}"
+me=$0
+
+version="git-version-gen $scriptversion
+
+Copyright 2011 Free Software Foundation, Inc.
+There is NO warranty. You may redistribute this software
+under the terms of the GNU General Public License.
+For more information about these matters, see the files named COPYING."
+
+usage="\
+Usage: $me [OPTION]... \$srcdir/.tarball-version [TAG-NORMALIZATION-SED-SCRIPT]
+Print a version string.
+
+Options:
+
+ --prefix PREFIX prefix of git tags (default 'v')
+ --fallback VERSION
+ fallback version to use if \"git --version\" fails
+
+ --help display this help and exit
+ --version output version information and exit
+
+Running without arguments will suffice in most cases."
+
+prefix=v
+fallback=
+
+while test $# -gt 0; do
+ case $1 in
+ --help) echo "$usage"; exit 0;;
+ --version) echo "$version"; exit 0;;
+ --prefix) shift; prefix=${1?};;
+ --fallback) shift; fallback=${1?};;
+ -*)
+ echo "$0: Unknown option '$1'." >&2
+ echo "$0: Try '--help' for more information." >&2
+ exit 1;;
+ *)
+ if test "x$tarball_version_file" = x; then
+ tarball_version_file="$1"
+ elif test "x$tag_sed_script" = x; then
+ tag_sed_script="$1"
+ else
+ echo "$0: extra non-option argument '$1'." >&2
+ exit 1
+ fi;;
+ esac
+ shift
+done
+
+if test "x$tarball_version_file" = x; then
+ echo "$usage"
+ exit 1
+fi
+
+tag_sed_script="${tag_sed_script:-s/x/x/}"
+
nl='
'
@@ -92,49 +144,64 @@ then
[0-9]*) ;;
*) v= ;;
esac
- test -z "$v" \
+ test "x$v" = x \
&& echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2
fi
-if test -n "$v"
+if test "x$v" != x
then
: # use $v
# Otherwise, if there is at least one git commit involving the working
# directory, and "git describe" output looks sensible, use that to
# derive a version string.
elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
- && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
+ && v=`git describe --abbrev=4 --match="$prefix*" HEAD 2>/dev/null \
|| git describe --abbrev=4 HEAD 2>/dev/null` \
&& v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
&& case $v in
- v[0-9]*) ;;
+ $prefix[0-9]*) ;;
*) (exit 1) ;;
esac
then
-
- # Remove the "g" in git describe's output string, to save a byte.
- v=`echo "$v" | sed 's/-g/-/'`;
-
- case $v in
- *-rc*)
- ;;
+ # Is this a new git that lists number of commits since the last
+ # tag or the previous older version that did not?
+ # Newer: v6.10-77-g0f8faeb
+ # Older: v6.10-g0f8faeb
+ vprefix=`expr "X$v" : 'X\(.*\)-g[^-]*$'` || vprefix=$v
+ case $vprefix in
+ *-*) : git describe is probably okay three part flavor ;;
*)
- # Change the first '-' to a '.', so version-comparing tools work properly.
- v=`echo "$v" | sed 's/-/./'`;
+ : git describe is older two part flavor
+ # Recreate the number of commits and rewrite such that the
+ # result is the same as if we were using the newer version
+ # of git describe.
+ vtag=`echo "$v" | sed 's/-.*//'`
+ commit_list=`git rev-list "$vtag"..HEAD 2>/dev/null` \
+ || { commit_list=failed;
+ echo "$0: WARNING: git rev-list failed" 1>&2; }
+ numcommits=`echo "$commit_list" | wc -l`
+ v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
+ test "$commit_list" = failed && v=UNKNOWN
;;
esac
+
+ # Change the penultimate "-" to ".", for version-comparing tools.
+ # Remove the "g" to save a byte.
+ v=`echo "$v" | sed 's/-\([^-]*\)-g\([^-]*\)$/.\1-\2/'`;
v_from_git=1
-else
+elif test "x$fallback" = x || git --version >/dev/null 2>&1; then
v=UNKNOWN
+else
+ v=$fallback
fi
-v=`echo "$v" |sed 's/^v//'`
+v=`echo "$v" |sed "s/^$prefix//"`
# Test whether to append the "-dirty" suffix only if the version
# string we're using came from git. I.e., skip the test if it's "UNKNOWN"
# or if it came from .tarball-version.
-if test -n "$v_from_git"; then
- # Don't declare a version "dirty" merely because a time stamp has changed.
+if test "x$v_from_git" != x; then
+ # Don't declare a version "dirty" merely because a timestamp has changed.
git update-index --refresh > /dev/null 2>&1
dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty=
@@ -149,12 +216,12 @@ if test -n "$v_from_git"; then
fi
# Omit the trailing newline, so that m4_esyscmd can use the result directly.
-echo "$v" | tr -d "$nl"
+printf %s "$v"
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
--
2.14.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 2/3] tools: update git-version-gen from gnulib
2017-09-17 18:49 ` [PATCH 2/3] tools: update git-version-gen from gnulib Sami Kerola
@ 2017-09-18 9:07 ` Karel Zak
2017-09-18 13:36 ` Rüdiger Meier
0 siblings, 1 reply; 8+ messages in thread
From: Karel Zak @ 2017-09-18 9:07 UTC (permalink / raw)
To: Sami Kerola; +Cc: util-linux
On Sun, Sep 17, 2017 at 07:49:01PM +0100, Sami Kerola wrote:
> from-gnulib-commit: e277cd7c6cf6435d9d4d380fd6cef0510e3f5afe
> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
> ---
> tools/git-version-gen | 137 +++++++++++++++++++++++++++++++++++++-------------
> 1 file changed, 102 insertions(+), 35 deletions(-)
I'm not sure about this. Did you check all the changes?
We have some local changes to the file, see
git whatchanged tools/git-version-gen
It would be nice to be sure that all works as expected.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 2/3] tools: update git-version-gen from gnulib
2017-09-18 9:07 ` Karel Zak
@ 2017-09-18 13:36 ` Rüdiger Meier
2017-09-20 11:56 ` Sami Kerola
0 siblings, 1 reply; 8+ messages in thread
From: Rüdiger Meier @ 2017-09-18 13:36 UTC (permalink / raw)
To: Karel Zak, Sami Kerola; +Cc: util-linux
On 09/18/2017 11:07 AM, Karel Zak wrote:
> On Sun, Sep 17, 2017 at 07:49:01PM +0100, Sami Kerola wrote:
>> from-gnulib-commit: e277cd7c6cf6435d9d4d380fd6cef0510e3f5afe
>> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
>> ---
>> tools/git-version-gen | 137 +++++++++++++++++++++++++++++++++++++-------------
>> 1 file changed, 102 insertions(+), 35 deletions(-)
>
> I'm not sure about this. Did you check all the changes?
>
> We have some local changes to the file, see
>
> git whatchanged tools/git-version-gen
>
> It would be nice to be sure that all works as expected.
I wouldn't touch this neither. Last year I've reviewed that really carefully
while fixing some issues with broken version numbers, see 85004b14 and also
the other ones from the same patch-set. Seems that Sami's patch would revert
some of these changes.
At that time there was also the question why not following gnulib and I tried to
justify this like this:
https://www.spinics.net/lists/util-linux-ng/msg13374.html
cu,
Rudi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] tools: update git-version-gen from gnulib
2017-09-18 13:36 ` Rüdiger Meier
@ 2017-09-20 11:56 ` Sami Kerola
0 siblings, 0 replies; 8+ messages in thread
From: Sami Kerola @ 2017-09-20 11:56 UTC (permalink / raw)
To: Rüdiger Meier; +Cc: Karel Zak, util-linux
On 18 September 2017 at 14:36, R=C3=BCdiger Meier <sweet_f_a@gmx.de> wrote:
> On 09/18/2017 11:07 AM, Karel Zak wrote:
>> On Sun, Sep 17, 2017 at 07:49:01PM +0100, Sami Kerola wrote:
>>> from-gnulib-commit: e277cd7c6cf6435d9d4d380fd6cef0510e3f5afe
>>> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
>>> ---
>>> tools/git-version-gen | 137
>>> +++++++++++++++++++++++++++++++++++++-------------
>>> 1 file changed, 102 insertions(+), 35 deletions(-)
>>
>>
>> I'm not sure about this. Did you check all the changes?
>>
>> We have some local changes to the file, see
>>
>> git whatchanged tools/git-version-gen
>> It would be nice to be sure that all works as expected.
>
>
> I wouldn't touch this neither. Last year I've reviewed that really carefu=
lly
> while fixing some issues with broken version numbers, see 85004b14 and al=
so
> the other ones from the same patch-set. Seems that Sami's patch would rev=
ert
> some of these changes.
>
> At that time there was also the question why not following gnulib and I
> tried to
> justify this like this:
>
> https://www.spinics.net/lists/util-linux-ng/msg13374.html
Hi Rudi and Karel,
Oh yes, I did not think too much how this was modified to be
util-linux specific.
Adding a comment that will tell it clearly that one should not simply sync =
from
gnulib would be nice.
--=20
Sami Kerola
http://www.iki.fi/kerolasa/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/3] bash-completion: update uuidgen, wipefs, tunelp, setpriv, and hwclock
2017-09-17 18:49 [PATCH 1/3] docs: remove repeated word from mount(8) man page Sami Kerola
2017-09-17 18:49 ` [PATCH 2/3] tools: update git-version-gen from gnulib Sami Kerola
@ 2017-09-17 18:49 ` Sami Kerola
2017-09-18 9:08 ` Karel Zak
2017-09-18 9:05 ` [PATCH 1/3] docs: remove repeated word from mount(8) man page Karel Zak
2 siblings, 1 reply; 8+ messages in thread
From: Sami Kerola @ 2017-09-17 18:49 UTC (permalink / raw)
To: util-linux; +Cc: Sami Kerola
uuidgen: Add hash-based UUIDs to bash-completion. These were added in
commit c6f1ec68a8b38863efff2a18e30b7272db4fb273.
wipefs: Command started to use libsmartcols, and it got some new options.
Commit d9921b2a128f17aa9a9a110444d5faa43e1b371c.
rename: New option was added in commit fabb90676af89bcb5f429793746f141c0.
tunelp: The --trust-irq was removed it being years broken. Commit
d52eb4bd9062081c8420b22c029c694f29d036c7.
setpriv: Add --ambient-caps option from commit 0c92194eeee9c1fd58580ef852.
In same go fix 'bash set -u' issue, that is the same as mentioned commit
abbcec4fc9c8d7fb835b4eafd1bc9d82acbf0056.
hwclock: For some reason --get has always been missing from this file.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
bash-completion/hwclock | 1 +
bash-completion/rename | 2 +-
bash-completion/setpriv | 5 +++--
bash-completion/tunelp | 3 +--
bash-completion/uuidgen | 20 +++++++++++++++++++-
bash-completion/wipefs | 19 ++++++++++++++++++-
6 files changed, 43 insertions(+), 7 deletions(-)
diff --git a/bash-completion/hwclock b/bash-completion/hwclock
index b90f00c0c..4bd87e42e 100644
--- a/bash-completion/hwclock
+++ b/bash-completion/hwclock
@@ -27,6 +27,7 @@ _hwclock_module()
-*)
OPTS="--help
--show
+ --get
--set
--hctosys
--systohc
diff --git a/bash-completion/rename b/bash-completion/rename
index 06a7dcd4d..143121976 100644
--- a/bash-completion/rename
+++ b/bash-completion/rename
@@ -11,7 +11,7 @@ _rename_module()
esac
case $cur in
-*)
- OPTS="--verbose --symlink --help --version --no-act"
+ OPTS="--verbose --symlink --help --version --no-act --no-override"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;
diff --git a/bash-completion/setpriv b/bash-completion/setpriv
index bdd3b7dab..8ab9e0722 100644
--- a/bash-completion/setpriv
+++ b/bash-completion/setpriv
@@ -5,14 +5,14 @@ _setpriv_module()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
- '--inh-caps'|'--bounding-set')
+ '--ambient-caps'|'--inh-caps'|'--bounding-set')
local prefix realcur INHERIT_ALL INHERIT
realcur="${cur##*,}"
prefix="${cur%$realcur}"
INHERIT_ALL=$($1 --list-caps| awk '{print $1, "-" $1}')
for WORD in $INHERIT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
- INHERIT="$WORD $INHERIT"
+ INHERIT="$WORD ${INHERIT:-""}"
fi
done
compopt -o nospace
@@ -70,6 +70,7 @@ _setpriv_module()
-*)
OPTS="--dump
--no-new-privs
+ --ambient-caps
--inh-caps
--bounding-set
--ruid
diff --git a/bash-completion/tunelp b/bash-completion/tunelp
index bd2cce2aa..2be3d544d 100644
--- a/bash-completion/tunelp
+++ b/bash-completion/tunelp
@@ -17,7 +17,7 @@ _tunelp_module()
COMPREPLY=( $(compgen -W "microseconds" -- $cur) )
return 0
;;
- '-a'|'--abort'|'-o'|'--check-status'|'-C'|'--careful'|'-T'|'--trust-irq'|'-q'|'--print-irq')
+ '-a'|'--abort'|'-o'|'--check-status'|'-C'|'--careful'|'-q'|'--print-irq')
COMPREPLY=( $(compgen -W "off on" -- $cur) )
return 0
;;
@@ -35,7 +35,6 @@ _tunelp_module()
--check-status
--careful
--status
- --trust-irq
--reset
--print-irq
--help
diff --git a/bash-completion/uuidgen b/bash-completion/uuidgen
index 42d95d42f..8e64015c0 100644
--- a/bash-completion/uuidgen
+++ b/bash-completion/uuidgen
@@ -5,13 +5,31 @@ _uuidgen_module()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
+ '-n'|'--namespace')
+ COMPREPLY=( $(compgen -W "@dns @url @oid @x500 @x.500" -- "$cur") )
+ return 0
+ ;;
+ '-N'|'--name')
+ COMPREPLY=( $(compgen -W "name" -- "$cur") )
+ return 0
+ ;;
'-h'|'--help'|'-V'|'--version')
return 0
;;
esac
case $cur in
-*)
- OPTS="--random --time --version --help"
+ OPTS="
+ --random
+ --time
+ --namespace
+ --name
+ --md5
+ --sha1
+ --hex
+ --help
+ --version
+ "
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;
diff --git a/bash-completion/wipefs b/bash-completion/wipefs
index 577819182..13568ca32 100644
--- a/bash-completion/wipefs
+++ b/bash-completion/wipefs
@@ -5,6 +5,20 @@ _wipefs_module()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
+ '-O'|'--output')
+ local prefix realcur OUTPUT_ALL OUTPUT
+ realcur="${cur##*,}"
+ prefix="${cur%$realcur}"
+ OUTPUT_ALL="UUID LABEL LENGTH TYPE OFFSET USAGE DEVICE"
+ for WORD in $OUTPUT_ALL; do
+ if ! [[ $prefix == *"$WORD"* ]]; then
+ OUTPUT="$WORD ${OUTPUT:-""}"
+ fi
+ done
+ compopt -o nospace
+ COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) )
+ return 0
+ ;;
'-o'|'--offset')
COMPREPLY=( $(compgen -W "offset" -- $cur) )
return 0
@@ -25,12 +39,15 @@ _wipefs_module()
--all
--backup
--force
- --help
+ --noheadings
+ --json
--no-act
--offset
+ --output
--parsable
--quiet
--types
+ --help
--version
"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
--
2.14.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 3/3] bash-completion: update uuidgen, wipefs, tunelp, setpriv, and hwclock
2017-09-17 18:49 ` [PATCH 3/3] bash-completion: update uuidgen, wipefs, tunelp, setpriv, and hwclock Sami Kerola
@ 2017-09-18 9:08 ` Karel Zak
0 siblings, 0 replies; 8+ messages in thread
From: Karel Zak @ 2017-09-18 9:08 UTC (permalink / raw)
To: Sami Kerola; +Cc: util-linux
On Sun, Sep 17, 2017 at 07:49:02PM +0100, Sami Kerola wrote:
> bash-completion/hwclock | 1 +
> bash-completion/rename | 2 +-
> bash-completion/setpriv | 5 +++--
> bash-completion/tunelp | 3 +--
> bash-completion/uuidgen | 20 +++++++++++++++++++-
> bash-completion/wipefs | 19 ++++++++++++++++++-
> 6 files changed, 43 insertions(+), 7 deletions(-)
Applied, thanks.
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] docs: remove repeated word from mount(8) man page
2017-09-17 18:49 [PATCH 1/3] docs: remove repeated word from mount(8) man page Sami Kerola
2017-09-17 18:49 ` [PATCH 2/3] tools: update git-version-gen from gnulib Sami Kerola
2017-09-17 18:49 ` [PATCH 3/3] bash-completion: update uuidgen, wipefs, tunelp, setpriv, and hwclock Sami Kerola
@ 2017-09-18 9:05 ` Karel Zak
2 siblings, 0 replies; 8+ messages in thread
From: Karel Zak @ 2017-09-18 9:05 UTC (permalink / raw)
To: Sami Kerola; +Cc: util-linux
On Sun, Sep 17, 2017 at 07:49:00PM +0100, Sami Kerola wrote:
> sys-utils/mount.8 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 8+ messages in thread