[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#851814: apt-build: Broken postinst by less permissive sed



Package: apt-build
Version: 0.12.45
Severity: serious
Tags: patch

Dear QA Group:

Installing apt-build results in this error:

Setting up apt-build (0.12.45) ...
sed: character class syntax is [[:space:]], not [:space:]
dpkg: error processing package apt-build (--configure):
 subprocess installed post-installation script returned error exit
status 4
Processing triggers for man-db (2.7.6.1-2) ...
Errors were encountered while processing:
 apt-build

Discovered by Antonio Trujillo here:

https://lists.debian.org/msgid-search/dd7864af-d235-217c-74dc-bd1b5a086e83@juntadeandalucia.es

I think the following trivial patch should fix it, but I'm not
confident enough to push it to git because version in Debian archives
does not exactly match HEAD in git.

Thanks.

--- a/debian/postinst
+++ b/debian/postinst
@@ -75,7 +75,7 @@ if [ "$1" = "configure" ] ; then
     if [ -e "$source" ] ; then
 	    # comment in all sources lists if asked
 	    if [ "$add_to_sourceslist" = "false" ] ; then
-        sed -i -e "s|^[:space:]*$debline.*|#$debline|" "$source"
+        sed -i -e "s|^[[:space:]]*$debline.*|#$debline|" "$source"
       
       # check if source entry is already enabled
       elif grep -Eq "^[[:space:]]*$debline" "$source" ; then
@@ -149,12 +149,12 @@ if [ "$1" = "configure" ] ; then
   test -z "make_options" || grep -Eq '^[[:space:]]*make_options =' $CONFFILE || \
     echo "make_options =" >> $CONFFILE
   
-  sed -e "s|^[:space:]*build-dir =.*|build-dir = $build_dir|" \
-      -e "s|^[:space:]*repository-dir =.*|repository-dir = $repository_dir|" \
-      -e "s|^[:space:]*Olevel =.*|Olevel = $Olevel|" \
-      -e "s|^[:space:]*mtune =.*|mtune = $mtune|" \
-      -e "s|^[:space:]*options =.*|options = \" $options\"|" \
-      -e "s|^[:space:]*make_options =.*|make_options = \" $make_options\"|" \
+  sed -e "s|^[[:space:]]*build-dir =.*|build-dir = $build_dir|" \
+      -e "s|^[[:space:]]*repository-dir =.*|repository-dir = $repository_dir|" \
+      -e "s|^[[:space:]]*Olevel =.*|Olevel = $Olevel|" \
+      -e "s|^[[:space:]]*mtune =.*|mtune = $mtune|" \
+      -e "s|^[[:space:]]*options =.*|options = \" $options\"|" \
+      -e "s|^[[:space:]]*make_options =.*|make_options = \" $make_options\"|" \
       < $CONFFILE > $CONFFILE.tmp
   
   mv -f $CONFFILE.tmp $CONFFILE


Reply to: