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

version graph

Package: apt-build; Maintainer for apt-build is Debian QA Group <packages@qa.debian.org>; Source for apt-build is src:apt-build (PTS, buildd, popcon).

Reported by: Santiago Vila <sanvila@unex.es>

Date: Thu, 19 Jan 2017 00:51:01 UTC

Severity: serious

Tags: confirmed, patch, sid, stretch

Found in version apt-build/0.12.45

Fixed in version apt-build/0.12.46

Done: Axel Beckert <abe@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, sanvila@unex.es, abe@debian.org, Debian QA Group <packages@qa.debian.org>:
Bug#851814; Package apt-build. (Thu, 19 Jan 2017 00:51:04 GMT) (full text, mbox, link).


Acknowledgement sent to Santiago Vila <sanvila@unex.es>:
New Bug report received and forwarded. Copy sent to sanvila@unex.es, abe@debian.org, Debian QA Group <packages@qa.debian.org>. (Thu, 19 Jan 2017 00:51:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Santiago Vila <sanvila@unex.es>
To: Debian BTS <submit@bugs.debian.org>
Subject: apt-build: Broken postinst by less permissive sed
Date: Thu, 19 Jan 2017 01:47:55 +0100 (CET)
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



Added tag(s) pending and confirmed. Request was from Axel Beckert <abe@debian.org> to control@bugs.debian.org. (Thu, 19 Jan 2017 14:48:03 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian QA Group <packages@qa.debian.org>:
Bug#851814; Package apt-build. (Thu, 19 Jan 2017 15:09:02 GMT) (full text, mbox, link).


Acknowledgement sent to Axel Beckert <abe@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian QA Group <packages@qa.debian.org>. (Thu, 19 Jan 2017 15:09:02 GMT) (full text, mbox, link).


Message #12 received at 851814@bugs.debian.org (full text, mbox, reply):

From: Axel Beckert <abe@debian.org>
To: Santiago Vila <sanvila@unex.es>, 851814@bugs.debian.org
Subject: Re: Bug#851814: apt-build: Broken postinst by less permissive sed
Date: Thu, 19 Jan 2017 16:07:01 +0100
Hi Santiago,

Santiago Vila wrote:
> 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

Thanks for forwarding it. Such issues are not detected by just having
the package installed and using it occasionally. But triggering a
reinstallation showed it here, too.

> I think the following trivial patch should fix it,

Thanks for the patch. I'll do an QA upload soon.

> but I'm not confident enough to push it to git because version in
> Debian archives does not exactly match HEAD in git.

Yes, I understand. Point is that when I did the first QA upload there
were (seemingly dead) ITA-traces in the Git master brnach and I didn't
want to throw them away, so for the last RC-fix (back then for
Jessie), I branched off a branch named "jessie" based on the lasted
upload to Unstable. I now did the same for Stretch: Created a branch
"stretch" based on the branch "jessie". As soon as I've uploaded
apt-build, I'll merge back my changes into the "master" branch.

		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe@debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-    |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE



Reply sent to Axel Beckert <abe@debian.org>:
You have taken responsibility. (Thu, 19 Jan 2017 21:36:07 GMT) (full text, mbox, link).


Notification sent to Santiago Vila <sanvila@unex.es>:
Bug acknowledged by developer. (Thu, 19 Jan 2017 21:36:08 GMT) (full text, mbox, link).


Message #17 received at 851814-close@bugs.debian.org (full text, mbox, reply):

From: Axel Beckert <abe@debian.org>
To: 851814-close@bugs.debian.org
Subject: Bug#851814: fixed in apt-build 0.12.46
Date: Thu, 19 Jan 2017 21:33:39 +0000
Source: apt-build
Source-Version: 0.12.46

We believe that the bug you reported is fixed in the latest version of
apt-build, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 851814@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Axel Beckert <abe@debian.org> (supplier of updated apt-build package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Thu, 19 Jan 2017 21:56:57 +0100
Source: apt-build
Binary: apt-build
Architecture: source amd64
Version: 0.12.46
Distribution: unstable
Urgency: medium
Maintainer: Debian QA Group <packages@qa.debian.org>
Changed-By: Axel Beckert <abe@debian.org>
Description:
 apt-build  - frontend to apt to build, optimize and install packages
Closes: 672183 757296 851814
Changes:
 apt-build (0.12.46) unstable; urgency=medium
 .
   * QA upload.
 .
   [ Santiago Vila ]
   * Fix postinst compatibility with stricter sed syntax in more recent sed
     releases. (Closes: #851814)
 .
   [ Axel Beckert ]
   * Switch Vcs-Git headers from git:// to https://.
   * Make debian/control non-executable.
   * Enable all hardening build flags.
   * Declare compliance with Debian Policy 3.9.8.
   * Apply "wrap-and-sort -a".
   * Cherry-pick changes to several packaging files from commit 24b41459 by
     Dominique Lasserre from the never completed 0.13.1 release in the
     master branch. (See below.)
   * Remove /var/cache/apt-build/ on purge. (Closes: #672183)
   * Add a Date header to generated Release files (and hence
     unconditionally recreate the Release file) as required by the Debian
     Repository Format (c.f. https://wiki.debian.org/RepositoryFormat)
   * Quick and dirty implementation of SHA256 fields in apt-build's Release
     files to get rid of apt's "No Hash entry in Release file" warning.
 .
   [ Dominique Lasserre ]
   * Switch copyright format to DEP-5 1.0.
   * Simplify debian/rules.
   * Suggest gfortran. (c.f. #502379)
 .
   [ Américo Monteiro ]
   * Added Portuguese translation of manpage. (Closes: #757296)
Checksums-Sha1:
 59f2ca1c5e65af2dc00d9ef06900cc0bbe1401a1 1571 apt-build_0.12.46.dsc
 75f387e4cac94256c59aaf2a13c6b49de086f8ad 46196 apt-build_0.12.46.tar.xz
 770d1ff811977e8c959c8a253d14412e355319e2 7336 apt-build-dbgsym_0.12.46_amd64.deb
 6c2947a67f79cc54a8611e9a46c6a7db6667ca8f 4784 apt-build_0.12.46_amd64.buildinfo
 ce40c6d230a799b84111f06e625ee73b7f9b9a3a 41176 apt-build_0.12.46_amd64.deb
Checksums-Sha256:
 d42d49800016a79021624f3c0d197b912cca48938e14cb69dfdc951e26aab727 1571 apt-build_0.12.46.dsc
 42056ff5ea4cf202ec8440f13aae94c030dd0e1f5fdc441b352539e0127590e9 46196 apt-build_0.12.46.tar.xz
 8b81dda93e732bee69e6c005a099b5e0195382593a2691e50f057ac0206d603d 7336 apt-build-dbgsym_0.12.46_amd64.deb
 8f3a26dcb18a62ab431331a8ca4e2bde444106dc71582de16168f820642355d1 4784 apt-build_0.12.46_amd64.buildinfo
 3403f06ad6d74cfd0949692131b51fdd1ede824d0f0258ee02d83bf85e888d47 41176 apt-build_0.12.46_amd64.deb
Files:
 54d011c4feedfe7a87fba192901b44de 1571 devel optional apt-build_0.12.46.dsc
 4f2c026dca7105c134b41b77b74911f9 46196 devel optional apt-build_0.12.46.tar.xz
 15f7c85203e83a47a149294887518ea4 7336 debug extra apt-build-dbgsym_0.12.46_amd64.deb
 58fdebf30cd9071ade5cfab85dd7195a 4784 devel optional apt-build_0.12.46_amd64.buildinfo
 e5c97b07033f2b4525537830d64c4de3 41176 devel optional apt-build_0.12.46_amd64.deb

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEERoyJeTtCmBnp12Ema+Zjx1o1yXUFAliBKFkACgkQa+Zjx1o1
yXUjKQ/+NTpiP4acR4LgVITyLV8trPXXbvLo95zs1psykPU/sN4KvjrlnpJe2taX
zUedi9RXOifK0j2dNvDkn9q477SenR80dxPttI92uBh+++lG0bk4857GIt1Dqv8E
O7btt6WQyAYgdui29SIiueujuP2+j3Q2eVbGESbo9t790hrSQiPEZIkY+L5S2gjl
kELhBoKNObczvXAls1Q29eZ6lJgDZbglfUIh4ZyUP0/PXt9cscla8cQQIu7OBWtp
WG8fMdjVV0z4z6Z+fYqgRlWlxVy8JLziUYJu85X11fJJOf8L8Hsa6WOLaB56kLip
ft2jkoKEa7xn8Sp0Tycdq5zJ4kQM+2SEcOgU2j6aMLltCIrfF/WS+efhU1r4vvpz
076UtHDNnSQ0PAzWVyfNl7DOIHy/7UNkcqIQ3XxAWp7SIGV8kZA87rQnQ/pmrGin
XgpbRsD8G5EmPBgl+qh+3LTBfEOW/8ZcGxErFN+irnkFxvK2CMET6i+YviZGxwqF
s+QFCf9hcO4juBrGddjt8lu+UV+u+sTrVJgzm3dEFRDoDbS+U11UEDRutDcmNEuf
zv9f3M0zDmmgtbi8gQyFOmpk98S0ljNrs1k3lssHodks4nrwwx8fLQQe4a7sxp2A
NkxXSna6wyfd5RCzVR2QSWx0qG1O5nVVOuKvC3QfrOQ9M/xI9L0=
=O05l
-----END PGP SIGNATURE-----




Added tag(s) stretch and sid. Request was from Axel Beckert <abe@debian.org> to control@bugs.debian.org. (Sat, 28 Jan 2017 19:21:02 GMT) (full text, mbox, link).


Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 26 Feb 2017 07:26:58 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Jul 1 13:48:18 2023; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.