app-eselect/eselect-php: new revision to fix bashisms.
authorMichael Orlitzky <mjo@gentoo.org>
Sat, 29 Jul 2017 12:25:37 +0000 (08:25 -0400)
committerMichael Orlitzky <mjo@gentoo.org>
Sat, 29 Jul 2017 12:25:37 +0000 (08:25 -0400)
Thomas Arnett pointed out two bashisms in our php-fpm launcher, and
provided a new script that works with app-shells/dash. This commit
updates the launcher, and revisions the v0.9.4 ebuild to use it. I
fixed the live ebuild while I was at it.

Gentoo-Bug: 626496

Package-Manager: Portage-2.3.6, Repoman-2.3.1

app-eselect/eselect-php/eselect-php-0.9.4-r1.ebuild [moved from app-eselect/eselect-php/eselect-php-0.9.4.ebuild with 97% similarity]
app-eselect/eselect-php/eselect-php-9999.ebuild
app-eselect/eselect-php/files/php-fpm-launcher-r1 [deleted file]
app-eselect/eselect-php/files/php-fpm-launcher-r2 [new file with mode: 0644]

similarity index 97%
rename from app-eselect/eselect-php/eselect-php-0.9.4.ebuild
rename to app-eselect/eselect-php/eselect-php-0.9.4-r1.ebuild
index a05df2fe1bb94271388c8301bd5057218c1f46df..4dec17a54184dc832e6de019bf7a30da60faf86f 100644 (file)
@@ -45,7 +45,7 @@ src_install() {
        if use fpm ; then
                systemd_dotmpfilesd "${FILESDIR}/php-fpm.conf"
                exeinto /usr/libexec
-               newexe "${FILESDIR}/php-fpm-launcher-r1" php-fpm-launcher
+               newexe "${FILESDIR}/php-fpm-launcher-r2" php-fpm-launcher
        fi
 }
 
index 7a707fb148095c4272d3e1203dd241b7a0d4206d..f695558d423acffefd3fa8af8a8604c7a6cf7177 100644 (file)
@@ -50,7 +50,7 @@ src_install() {
        if use fpm ; then
                systemd_dotmpfilesd "${FILESDIR}/php-fpm.conf"
                exeinto /usr/libexec
-               newexe "${FILESDIR}/php-fpm-launcher-r1" php-fpm-launcher
+               newexe "${FILESDIR}/php-fpm-launcher-r2" php-fpm-launcher
        fi
 }
 
diff --git a/app-eselect/eselect-php/files/php-fpm-launcher-r1 b/app-eselect/eselect-php/files/php-fpm-launcher-r1
deleted file mode 100644 (file)
index c7cc2e9..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-source /lib/gentoo/functions.sh
-
-PHPSLOT="${1}"
-[ -z "${PHPSLOT}" ] && PHPSLOT="$(eselect php show fpm)"
-shift
-
-exec /usr/$(get_libdir)/${PHPSLOT}/bin/php-fpm "${@}"
diff --git a/app-eselect/eselect-php/files/php-fpm-launcher-r2 b/app-eselect/eselect-php/files/php-fpm-launcher-r2
new file mode 100644 (file)
index 0000000..db07a13
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -o errexit
+
+. /lib/gentoo/functions.sh
+
+# If there are no arguments, then "shift" will fail (bug 626496).
+if [ $# -eq 0 ]; then
+    PHP_SLOT=$(eselect php show fpm)
+else
+    PHP_SLOT=$1
+    shift
+fi
+
+exec "/usr/$(get_libdir)/${PHP_SLOT}/bin/php-fpm" "${@}"