Bug#916028: cltl: solving some upgrade issues
Package: cltl
Version: 1.0.29
Severity: important
Tags: patch
User: debian-qa@lists.debian.org
Usertags: piuparts
Hi,
attached you can find a patch to fix some upgrading issues (upgrading
from the 1.0.26 in wheezy to buster) that I noticed while running
piuparts on contrib locally.
* preinst: Disable buggy postrm code on upgrades from (<< 1.0.27) that would
delete files from the newly unpacked package. (Cf. #700670)
* Clean up the obsolete conffile /etc/emacs/site-start.d/60cltl.el on
upgrade.
* Use /var/cache/cltl as download location.
Andreas
diff -Nru cltl-1.0.29/debian/changelog cltl-1.0.30/debian/changelog
--- cltl-1.0.29/debian/changelog 2018-04-14 10:15:35.000000000 +0200
+++ cltl-1.0.30/debian/changelog 2018-12-08 23:59:44.000000000 +0100
@@ -1,3 +1,14 @@
+cltl (1.0.30) UNRELEASED; urgency=medium
+
+ [ Andreas Beckmann ]
+ * preinst: Disable buggy postrm code on upgrades from (<< 1.0.27) that would
+ delete files from the newly unpacked package. (Cf. #700670)
+ * Clean up the obsolete conffile /etc/emacs/site-start.d/60cltl.el on
+ upgrade.
+ * Use /var/cache/cltl as download location.
+
+ -- Andreas Beckmann <anbe@debian.org> Sat, 08 Dec 2018 23:59:44 +0100
+
cltl (1.0.29) unstable; urgency=medium
* Team upload.
diff -Nru cltl-1.0.29/debian/cltl.maintscript cltl-1.0.30/debian/cltl.maintscript
--- cltl-1.0.29/debian/cltl.maintscript 1970-01-01 01:00:00.000000000 +0100
+++ cltl-1.0.30/debian/cltl.maintscript 2018-12-08 23:59:44.000000000 +0100
@@ -0,0 +1 @@
+rm_conffile /etc/emacs/site-start.d/60cltl.el 1.0.30~
diff -Nru cltl-1.0.29/debian/postinst cltl-1.0.30/debian/postinst
--- cltl-1.0.29/debian/postinst 2018-04-14 10:03:54.000000000 +0200
+++ cltl-1.0.30/debian/postinst 2018-12-08 23:59:44.000000000 +0100
@@ -23,7 +23,7 @@
INDEX=/usr/share/doc/cltl/cltl2.html
URL=http://www-2.cs.cmu.edu/afs/cs.cmu.edu/project/ai-repository/ai/lang/lisp/doc/cltl/cltl_ht.tgz
-FILE_DIR=/root/tmp
+FILE_DIR=/var/cache/cltl
FILE=${FILE_DIR}/cltl_ht.tgz
DOCDIR=/usr/share/doc/cltl
diff -Nru cltl-1.0.29/debian/postrm cltl-1.0.30/debian/postrm
--- cltl-1.0.29/debian/postrm 1970-01-01 01:00:00.000000000 +0100
+++ cltl-1.0.30/debian/postrm 2018-12-08 23:59:44.000000000 +0100
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -e
+
+if [ "$1" = "purge" ];
+then
+ rm -rf /var/cache/cltl
+fi
+
+#DEBHELPER#
diff -Nru cltl-1.0.29/debian/preinst cltl-1.0.30/debian/preinst
--- cltl-1.0.29/debian/preinst 1970-01-01 01:00:00.000000000 +0100
+++ cltl-1.0.30/debian/preinst 2018-12-08 23:59:44.000000000 +0100
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -e
+
+# work around "#700670 - 'old-postrm upgrade' removes /usr/share/doc/cltl/*
+# after the new package was unpacked"
+# by disabling the offending line
+if dpkg --compare-versions "$2" lt-nl "1.0.27" ; then
+ if [ -f /var/lib/dpkg/info/cltl.postrm ]; then
+ echo "Disabling buggy code in old postrm script..."
+ sed -ir '8{\%^rm -rf /usr/share/doc/cltl/\*\s*$%{s/^/#/}}' /var/lib/dpkg/info/cltl.postrm
+ fi
+fi
+
+#DEBHELPER#
Reply to: