sys-apps/util-linux: Revbump fix bash-completion umount code execution
authorLars Wendler <polynomial-c@gentoo.org>
Wed, 7 Mar 2018 09:27:46 +0000 (10:27 +0100)
committerLars Wendler <polynomial-c@gentoo.org>
Wed, 7 Mar 2018 09:27:46 +0000 (10:27 +0100)
Committed straight to stable.

Bug: https://bugs.gentoo.org/649812
Package-Manager: Portage-2.3.24, Repoman-2.3.6

sys-apps/util-linux/files/util-linux-2.32_rc2-umount_completion.patch [new file with mode: 0644]
sys-apps/util-linux/util-linux-2.30.2-r1.ebuild [moved from sys-apps/util-linux/util-linux-2.30.2.ebuild with 98% similarity]
sys-apps/util-linux/util-linux-2.31.1-r1.ebuild [moved from sys-apps/util-linux/util-linux-2.31.1.ebuild with 98% similarity]

diff --git a/sys-apps/util-linux/files/util-linux-2.32_rc2-umount_completion.patch b/sys-apps/util-linux/files/util-linux-2.32_rc2-umount_completion.patch
new file mode 100644 (file)
index 0000000..1317c56
--- /dev/null
@@ -0,0 +1,41 @@
+From 75f03badd7ed9f1dd951863d75e756883d3acc55 Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Thu, 16 Nov 2017 16:27:32 +0100
+Subject: [PATCH] bash-completion: (umount) use findmnt, escape a space in
+ paths
+
+ # mount /dev/sdc1 /mnt/test/foo\ bar
+ # umount <tab>
+
+has to return "/mnt/test/foo\ bar".
+
+Changes:
+
+ * don't use mount | awk output, we have findmnt
+ * force compgen use \n as entries separator
+
+Addresses: https://github.com/karelzak/util-linux/issues/539
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+ bash-completion/umount | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/bash-completion/umount b/bash-completion/umount
+index d76cb9fff..98c90d61a 100644
+--- a/bash-completion/umount
++++ b/bash-completion/umount
+@@ -40,9 +40,10 @@ _umount_module()
+                       return 0
+                       ;;
+       esac
+-      local DEVS_MPOINTS
+-      DEVS_MPOINTS="$(mount | awk '{print $1, $3}')"
+-      COMPREPLY=( $(compgen -W "$DEVS_MPOINTS" -- $cur) )
+-      return 0
++
++      local oldifs=$IFS
++      IFS=$'\n'
++      COMPREPLY=( $( compgen -W '$(findmnt -lno TARGET | sed "s/\([[:blank:]]\)/\\\\\1/g")' -- "$cur" ) )
++      IFS=$oldifs
+ }
+ complete -F _umount_module umount
similarity index 98%
rename from sys-apps/util-linux/util-linux-2.30.2.ebuild
rename to sys-apps/util-linux/util-linux-2.30.2-r1.ebuild
index 09c71996e9029a43b968034bcb472e97488e5c3d..3077f85b78e75ef72e3120484875fead799b78c5 100644 (file)
@@ -61,6 +61,10 @@ REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
 
 S="${WORKDIR}/${MY_P}"
 
+PATCHES=(
+       "${FILESDIR}/${PN}-2.32_rc2-umount_completion.patch" #649812
+)
+
 pkg_setup() {
        use python && python-single-r1_pkg_setup
 }
similarity index 98%
rename from sys-apps/util-linux/util-linux-2.31.1.ebuild
rename to sys-apps/util-linux/util-linux-2.31.1-r1.ebuild
index 41dd4c18eec5dbc3663ebfd2000557cf352bd8e0..ce356da9a592a111e069d2db745ac3cfeb39a26c 100644 (file)
@@ -62,6 +62,10 @@ REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
 
 S="${WORKDIR}/${MY_P}"
 
+PATCHES=(
+       "${FILESDIR}/${PN}-2.32_rc2-umount_completion.patch" #649812
+)
+
 pkg_setup() {
        use python && python-single-r1_pkg_setup
 }