sys-libs/libblockdev: Don't use bashisms in configure script
authorLars Wendler <polynomial-c@gentoo.org>
Tue, 12 May 2020 18:39:26 +0000 (20:39 +0200)
committerLars Wendler <polynomial-c@gentoo.org>
Tue, 12 May 2020 18:44:09 +0000 (20:44 +0200)
Closes: https://bugs.gentoo.org/719442
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
sys-libs/libblockdev/files/libblockdev-2.23-avoid_bashisms.patch [new file with mode: 0644]
sys-libs/libblockdev/libblockdev-2.23-r1.ebuild

diff --git a/sys-libs/libblockdev/files/libblockdev-2.23-avoid_bashisms.patch b/sys-libs/libblockdev/files/libblockdev-2.23-avoid_bashisms.patch
new file mode 100644 (file)
index 0000000..9c4f94b
--- /dev/null
@@ -0,0 +1,41 @@
+From e6ab6918ffac65da2d562cb286c6ab50eaf62ca2 Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Mon, 11 May 2020 22:14:26 +0200
+Subject: [PATCH] configure.ac: Avoid bashisms
+
+or else we get unpredictable results with shells != /bin/bash like:
+
+checking for gobject-introspection... no (disabled, use --enable-introspection to enable)
+./configure: 13672: test: xno: unexpected operator
+checking for python3... /var/tmp/portage/sys-libs/libblockdev-2.23-r1/temp/python3.8/bin/python3
+./configure: 13838: test: x/var/tmp/portage/sys-libs/libblockdev-2.23-r1/temp/python3.8/bin/python3: unexpected operator
+
+Reported-by: Matt Whitlock <gentoo@mattwhitlock.name>
+Gentoo-bug: https://bugs.gentoo.org/719442
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ded64259..bbdff5e7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -60,7 +60,7 @@ AC_ARG_WITH([python3],
+ AC_SUBST(WITH_PYTHON3, 0)
+ if test "x$with_python3" != "xno"; then
+     AC_PATH_PROG([python3], [python3], [no])
+-    AS_IF([test "x$python3" == "xno"],
++    AS_IF([test "x$python3" = "xno"],
+     [if test "x$with_python3" = "xyes"; then
+       LIBBLOCKDEV_SOFT_FAILURE([Python3 support requested, but python3 is not available])
+       fi],
+@@ -77,7 +77,7 @@ AC_ARG_WITH([gtk-doc],
+ AC_SUBST(WITH_GTK_DOC, 0)
+ if test "x$with_gtk_doc" != "xno"; then
+     AC_PATH_PROG([gtkdoc_scan], [gtkdoc-scan], [no])
+-    AS_IF([test "x$gtkdoc_scan" == "xno"],
++    AS_IF([test "x$gtkdoc_scan" = "xno"],
+     [if test "x$with_gtk_doc" = "xyes"; then
+       LIBBLOCKDEV_SOFT_FAILURE([Building documentation with gtk-doc requested, but not available])
+       fi],
index c252b7d2104f8f0ee90e3b6ffdad9a00be677c59..105df4812baa08d89e83dbd113ae0b28f5eee73d 100644 (file)
@@ -4,12 +4,12 @@
 EAPI=7
 
 PYTHON_COMPAT=( python3_{6,7,8} )
-inherit python-single-r1 xdg-utils
+inherit autotools python-single-r1 xdg-utils
 
 DESCRIPTION="A library for manipulating block devices"
 HOMEPAGE="https://github.com/storaged-project/libblockdev"
 if [[ "${PV}" == *9999 ]] ; then
-       inherit autotools git-r3
+       inherit git-r3
        EGIT_REPO_URI="https://github.com/storaged-project/libblockdev.git"
        BDEPEND="
                sys-devel/autoconf-archive
@@ -66,6 +66,8 @@ BDEPEND+="
 REQUIRED_USE="${PYTHON_REQUIRED_USE}
                escrow? ( cryptsetup )"
 
+PATCHES=( "${FILESDIR}/${P}-avoid_bashisms.patch" ) #719442
+
 pkg_setup() {
        python-single-r1_pkg_setup
 }
@@ -73,7 +75,7 @@ pkg_setup() {
 src_prepare() {
        xdg_environment_reset #623992
        default
-       [[ "${PV}" == *9999 ]] && eautoreconf
+       eautoreconf
 }
 
 src_configure() {