Skip to contentSkip to conversation

docs: remove repeated word from mount(8) man page

PATCH Applied Sami Kerola 3 participants 8 messages Sep 17, 2017 – Sep 20, 2017 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 docs: remove repeated word from mount(8) man page

---
 sys-utils/mount.8 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sys-utils/mount.8 +1 -1
index 52c8bdab3..4f9500593 100644
@@ -1715,7 +1715,7 @@ local time.
 Set offset for conversion of timestamps from local time used by FAT to UTC.
 I.e.,
 .I minutes
-minutes will be subtracted from each timestamp to convert it to UTC used
+will be subtracted from each timestamp to convert it to UTC used
 internally by Linux.  This is useful when the time zone set in the kernel via
 .BR settimeofday (2)
 is not the time zone used by the filesystem.  Note
Signature · 1 line
2.14.1
#1 lore raw

PATCH 2/3 tools: update git-version-gen from gnulib

from-gnulib-commit: e277cd7c6cf6435d9d4d380fd6cef0510e3f5afe

---
 tools/git-version-gen | 137 +++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 102 insertions(+), 35 deletions(-)
tools/git-version-gen +102 -35
index b287cb794..0e254f4be 100755
@@ -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:
Signature · 1 line
2.14.1
maintainer
#2 lore raw

Re: [PATCH 2/3] tools: update git-version-gen from gnulib

Quoted 5 lines · Sami Kerola

from-gnulib-commit: e277cd7c6cf6435d9d4d380fd6cef0510e3f5afe

---
 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

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#3 lore raw

Re: [PATCH 2/3] tools: update git-version-gen from gnulib

Quoted 7 lines · Karel Zak
Quoted 5 lines · Sami Kerola

from-gnulib-commit: e277cd7c6cf6435d9d4d380fd6cef0510e3f5afe

---
  tools/git-version-gen | 137 +++++++++++++++++++++++++++++++++++++-------------
  1 file changed, 102 insertions(+), 35 deletions(-)
Quoted 7 lines

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

#4 lore raw

Re: [PATCH 2/3] tools: update git-version-gen from gnulib

Quoted 12 lines · On 18 September 2017 at 14:36, R=C3=BCdiger Meier <[email protected]> wrote:
Quoted 11 lines · Karel Zak
Quoted 6 lines · Sami Kerola

from-gnulib-commit: e277cd7c6cf6435d9d4d380fd6cef0510e3f5afe

---
  tools/git-version-gen | 137
+++++++++++++++++++++++++++++++++++++-------------
  1 file changed, 102 insertions(+), 35 deletions(-)

I'm not sure about this. Did you check all the changes?

Quoted 7 lines
Quoted 4 lines

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

Quoted 1 line

while fixing some issues with broken version numbers, see 85004b14 and al=

so

Quoted 1 line

the other ones from the same patch-set. Seems that Sami's patch would rev=

ert

Quoted 7 lines

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/

#5 lore raw

PATCH 3/3 bash-completion: update uuidgen, wipefs, tunelp, setpriv, and hwclock

In reply to 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.

---
 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(-)
bash-completion/hwclock +1 -0
index b90f00c0c..4bd87e42e 100644
@@ -27,6 +27,7 @@ _hwclock_module()
 		-*)
 			OPTS="--help
 				--show
+				--get
 				--set
 				--hctosys
 				--systohc
bash-completion/rename +1 -1
index 06a7dcd4d..143121976 100644
@@ -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
 			;;
bash-completion/setpriv +3 -2
index bdd3b7dab..8ab9e0722 100644
@@ -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
bash-completion/tunelp +1 -2
index bd2cce2aa..2be3d544d 100644
@@ -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
bash-completion/uuidgen +19 -1
index 42d95d42f..8e64015c0 100644
@@ -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
 			;;
bash-completion/wipefs +18 -1
index 577819182..13568ca32 100644
@@ -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) )
Signature · 1 line
2.14.1
maintainer Applied
#6 lore raw

Re: [PATCH 3/3] bash-completion: update uuidgen, wipefs, tunelp, setpriv, and hwclock

Quoted 7 lines · Sami Kerola
 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.

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com