Merge lp:~mitya57/ubuntu/trusty/python-coverage/add-preinst-script into lp:ubuntu/trusty/python-coverage

Proposed by Dmitry Shachnev
Status: Merged
Merged at revision: 23
Proposed branch: lp:~mitya57/ubuntu/trusty/python-coverage/add-preinst-script
Merge into: lp:ubuntu/trusty/python-coverage
Diff against target: 59 lines (+47/-0)
2 files modified
debian/changelog (+9/-0)
debian/python3-coverage.preinst (+38/-0)
To merge this branch: bzr merge lp:~mitya57/ubuntu/trusty/python-coverage/add-preinst-script
Reviewer Review Type Date Requested Status
Daniel Holbach (community) Approve
Review via email: mp+202323@code.launchpad.net

Description of the change

This fixes Saucy→Trusty upgrades (the problem was described at http://bugs.debian.org/734850, but actually it's Ubuntu-specific problem, and the fix is not needed in Debian).

To post a comment you must log in.
Revision history for this message
Daniel Holbach (dholbach) wrote :

As we have two supported python3 versions, you might need this excerpt in the preinst too:

   for python in $(py3versions --supported) ; do

......

review: Needs Fixing
Revision history for this message
Daniel Holbach (dholbach) wrote :

Sorry, ignore the last comment please.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Thanks. Uploaded.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-01-13 14:51:52 +0000
3+++ debian/changelog 2014-01-20 15:19:50 +0000
4@@ -1,3 +1,12 @@
5+python-coverage (3.7+dfsg.1-4ubuntu1) trusty; urgency=medium
6+
7+ * Add python3-coverage.preinst (based on existing python-coverage.preinst)
8+ to correctly handle upgrades from previous releases. Previously
9+ /usr/lib/python3/dist-packages/coverage/htmlfiles was a directory,
10+ now it is a symbolic link (see Debian #734850).
11+
12+ -- Dmitry Shachnev <mitya57@ubuntu.com> Mon, 20 Jan 2014 19:08:47 +0400
13+
14 python-coverage (3.7+dfsg.1-4) unstable; urgency=medium
15
16 * The “Thorpekai Yousafzai” release.
17
18=== added file 'debian/python3-coverage.preinst'
19--- debian/python3-coverage.preinst 1970-01-01 00:00:00 +0000
20+++ debian/python3-coverage.preinst 2014-01-20 15:19:50 +0000
21@@ -0,0 +1,38 @@
22+#! /bin/sh
23+# Pre-install script for ‘python3-coverage’.
24+#
25+# Manpage: ‘dh_installdeb(1)’
26+
27+set -e
28+
29+# Summary of ways this script can be called:
30+# * <new-preinst> install
31+# * <new-preinst> install <old-version>
32+# * <new-preinst> upgrade <old-version>
33+# * <old-preinst> abort-upgrade <new-version>
34+# For details, see the Debian Policy §6.5 in the ‘debian-policy’ package
35+# or on the web at <URL:http://www.debian.org/doc/debian-policy/>.
36+
37+action="$1"
38+
39+case "$action" in
40+ upgrade)
41+ htmlfiles_dir="/usr/lib/python3/dist-packages/coverage/htmlfiles"
42+ if [ -d "$htmlfiles_dir" ] && [ ! -L "$htmlfiles_dir" ] ; then
43+ # The ‘htmlfiles’ location should be platform-independent.
44+ # The new package will replace the directory with a symlink.
45+ rm -rf "$htmlfiles_dir"
46+ fi
47+ ;;
48+
49+ install|abort-upgrade)
50+ ;;
51+
52+ *)
53+ printf "preinst called with unknown action ‘%s’\n" "$action" >&2
54+ exit 1
55+ ;;
56+
57+esac
58+
59+#DEBHELPER#

Subscribers

People subscribed via source and target branches