[php-maint] php7.0: fix-up command-not-found for php-config and phpize

Nish Aravamudan nish.aravamudan at canonical.com
Fri Jan 15 18:27:44 UTC 2016


[ Apologies if I made a mistake, this is my first attempt at push a fix
to Debian. ]

The current php-dev.{postinst,prerm} scripts refer to an iterated
variable as "$i" which causes command-not-found's automated extractor to
not parse the underlying substitutions and so in Ubuntu Xenial, e.g.,
php-config does not exist as a possible solution for c-n-f.

diff -Nru php7.0-7.0.2/debian/changelog php7.0-7.0.2/debian/changelog
--- php7.0-7.0.2/debian/changelog	2016-01-15 01:40:34.000000000 -0800
+++ php7.0-7.0.2/debian/changelog	2016-01-15 10:23:15.000000000 -0800
@@ -1,3 +1,12 @@
+php7.0 (7.0.2-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * debian/php-dev.{postinst,prerm}: Use ${i} instead of "$i" in
+    update-alternatives invocation so that command-not-found can parse
+    the script(s).
+
+ -- Nishanth Aravamudan <nish.aravamudan at canonical.com>  Fri, 15 Jan 2016 10:17:42 -0800
+
 php7.0 (7.0.2-3) unstable; urgency=medium
 
   * Fail gracefully when other PHP module is enabled in Apache2 (Closes: #811005)
diff -Nru php7.0-7.0.2/debian/php-dev.postinst php7.0-7.0.2/debian/php-dev.postinst
--- php7.0-7.0.2/debian/php-dev.postinst	2016-01-15 01:40:34.000000000 -0800
+++ php7.0-7.0.2/debian/php-dev.postinst	2016-01-15 10:18:38.000000000 -0800
@@ -5,8 +5,8 @@
 if [ "$1" = "configure" ]; then
     for i in php-config phpize; do
 	update-alternatives \
-	    --install /usr/bin/"$i" $i /usr/bin/"$i"@PHP_VERSION@ @PHP_MAJOR@@PHP_MINOR@ \
-	    --slave /usr/share/man/man1/"$i".1.gz "$i".1.gz /usr/share/man/man1/"$i"@PHP_VERSION at .1.gz
+	    --install /usr/bin/${i} ${i} /usr/bin/${i}@PHP_VERSION@ @PHP_MAJOR@@PHP_MINOR@ \
+	    --slave /usr/share/man/man1/${i}.1.gz ${i}.1.gz /usr/share/man/man1/${i}@PHP_VERSION at .1.gz
     done
 fi
 
diff -Nru php7.0-7.0.2/debian/php-dev.prerm php7.0-7.0.2/debian/php-dev.prerm
--- php7.0-7.0.2/debian/php-dev.prerm	2016-01-15 01:40:34.000000000 -0800
+++ php7.0-7.0.2/debian/php-dev.prerm	2016-01-15 10:19:24.000000000 -0800
@@ -4,7 +4,7 @@
 
 if [ "$1" = "remove" -o "$1" = "purge" ]; then
     for i in php-config phpize; do
-	update-alternatives --remove $i /usr/bin/"$i"@PHP_VERSION@
+	update-alternatives --remove ${i} /usr/bin/${i}@PHP_VERSION@
     done
 fi

-- 
Nishanth Aravamudan
Ubuntu Server
Canonical Ltd



More information about the pkg-php-maint mailing list