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

Re: Bug#503712: the gs-common problem



Hi,

Thomas Viehmann wrote:
> Niko Tyni wrote:
>>> Maybe "configure script" is badly worded: It's most blatant abuse, but
>>> I'd just stick it into a /var/lib/dpkg/info/ghostscript.config
>>> unless there are apt-get-lookalikes that don't call that at the
>>> beginning of an upgrade. If the user produces the bad situation with
>>> dpkg by himself, well, who cares.
>> I see. It's blatant abuse indeed, but it might work.
>>
>> The preconfiguration only happens if debconf and apt-utils are installed
>> (see /etc/apt/apt.conf.d/70debconf and /usr/sbin/dpkg-preconfigure), but
>> according to popcon more than 99.8% of all installations have them. 
>>
>> If this is the chosen approach, the script could as well fix the etch
>> gs-common.prerm script instead of removing it; I think something like
>>
>> if md5sum --status --check <<EOF
>> 1959479be1e513d94a22f6fad8227fa3  /var/lib/dpkg/info/gs-common.prerm
>> EOF
>> then
>>     sed -i 's/defoma-app -t \(purge\|clean\) gs$/& || true/' \
>>         /var/lib/dpkg/info/gs-common.prerm || true
>> fi
>>
>> should do.
So this is how an NMU choosing the include hack in .config route would
look like.
I'm not quite convinced that this is actually better than having
ghosscript depend on gs-common, gs-common not depend on ghostscript-x
and checking the reverse (build-)depends for breakage.

I might investigate that option in some more detail, too, but now we
have an NMU option from the "gross hack that works for many situations"
department.

Kind regards

T.
-- 
Thomas Viehmann, http://thomas.viehmann.net/
diff -u ghostscript-8.62.dfsg.1/debian/changelog ghostscript-8.62.dfsg.1/debian/changelog
--- ghostscript-8.62.dfsg.1/debian/changelog
+++ ghostscript-8.62.dfsg.1/debian/changelog
@@ -1,3 +1,14 @@
+ghostscript (8.62.dfsg.1-3.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Gross hack: Add debian/ghostscript.config that attempts to fix
+    (etch) gs-common.prerm. This also necessitates the (otherwise
+    useless) ghostscript.templates.
+    Original idea from apache2->apache2.2,
+    details by Niko Tyni, bugs my own. Closes: #503712
+
+ -- Thomas Viehmann <tv@beamnet.de>  Sat, 27 Dec 2008 20:58:00 +0100
+
 ghostscript (8.62.dfsg.1-3.1) unstable; urgency=medium
 
   * Non-maintainer upload.
only in patch2:
unchanged:
--- ghostscript-8.62.dfsg.1.orig/debian/ghostscript.templates
+++ ghostscript-8.62.dfsg.1/debian/ghostscript.templates
@@ -0,0 +1,5 @@
+Template: ghostscript/dummy
+Type: text
+Description: Dummy template
+  to facilitate hack in ghostscript.config.
+
only in patch2:
unchanged:
--- ghostscript-8.62.dfsg.1.orig/debian/ghostscript.config
+++ ghostscript-8.62.dfsg.1/debian/ghostscript.config
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+# This is one gross hack, do not imitate. See bug #503712 for details.
+
+md5sum=$(md5sum /var/lib/dpkg/info/gs-common.prerm 2>/dev/null | cut -f1 -d' ' || true )
+case "$md5sum" in
+1959479be1e513d94a22f6fad8227fa3|7246294e40219cc849738edf49c1c852|0a6bfb6322d636faf08752d6427150c2)
+    sed -i 's/defoma-app -t \(purge\|clean\) gs$/& || true/' \
+    	/var/lib/dpkg/info/gs-common.prerm || true
+    ;;
+esac

Reply to: