On Sun, Jan 08, 2017 at 04:25:07PM -0400, David Bremner wrote:
> I agree we should fix both upgrade problems. But we should also document
> what we are actually fixing

Agreed.  I've pushed two more commits to the upgrade-fix branch.

If you approve, and have nothing else to add, I can perform a team upload.

-- 
Sean Whitton
From dc23d9be6631d1dcdbe909dde8402bf0faf8f640 Mon Sep 17 00:00:00 2001
From: Sean Whitton <[email protected]>
Date: Sun, 8 Jan 2017 14:59:24 -0700
Subject: [PATCH 2/3] simplify fix for xemacs21

---
 debian/elpa-company.prerm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/elpa-company.prerm b/debian/elpa-company.prerm
index 905d734..6595b40 100755
--- a/debian/elpa-company.prerm
+++ b/debian/elpa-company.prerm
@@ -8,7 +8,7 @@ set -e
 if [ "$1" = "failed-upgrade" ] && dpkg --compare-versions "$2" lt 0.8.12-5; then
     broken_remove_script="/usr/lib/emacsen-common/packages/remove/elpa-company"
     sed --quiet -i "$broken_remove_script" \
-        -e 's/find ${elc_dir} -type l -delete/[ -d ${elc_dir} ] && find ${elc_dir} -type l -delete/'
+        -e '/Skipping unsupported emacs ${FLAVOUR}/a \           exit 0'
     sed --quiet -i "$broken_remove_script" \
         -e 's/emacs23)/emacs2[0123]*)/'
 fi
-- 
2.11.0

From a7561341a6e9ed5b62ed46a7e39f6de6133cc4a9 Mon Sep 17 00:00:00 2001
From: Sean Whitton <[email protected]>
Date: Sun, 8 Jan 2017 14:59:32 -0700
Subject: [PATCH 3/3] properly document prerm script

---
 debian/elpa-company.prerm | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/debian/elpa-company.prerm b/debian/elpa-company.prerm
index 6595b40..6d4dc33 100755
--- a/debian/elpa-company.prerm
+++ b/debian/elpa-company.prerm
@@ -2,13 +2,19 @@
 
 set -e
 
-# fix upgrade from 0.8.12-5 and below, which can fail if xemacs21 is
-# also installed.  We manually upgrade the emacsen-common remove
-# script so that it won't exit non-zero, which blocks the upgrade
+# Pre-emptively upgrade emacsen-common remove script to deal with several
+# possible issues when upgrading from version 0.8.12-4 or older.  These can
+# cause the emacsen-common remove script to exit non-zero, breaking the package
+# upgrade
 if [ "$1" = "failed-upgrade" ] && dpkg --compare-versions "$2" lt 0.8.12-5; then
     broken_remove_script="/usr/lib/emacsen-common/packages/remove/elpa-company"
+
+    # (1) exit cleanly for xemacs21 -- without this, the call to find(1) can
+    # exit non-zero
     sed --quiet -i "$broken_remove_script" \
         -e '/Skipping unsupported emacs ${FLAVOUR}/a \           exit 0'
+
+    # (2) exit cleanly for yet older unsupported Emacsen that might be installed
     sed --quiet -i "$broken_remove_script" \
         -e 's/emacs23)/emacs2[0123]*)/'
 fi
-- 
2.11.0

Attachment: signature.asc
Description: PGP signature

Reply via email to