Merge lp:~barry/ubuntu-release-upgrader/lp1485093 into lp:ubuntu-release-upgrader

Proposed by Barry Warsaw
Status: Merged
Merged at revision: 2924
Proposed branch: lp:~barry/ubuntu-release-upgrader/lp1485093
Merge into: lp:ubuntu-release-upgrader
Diff against target: 59 lines (+21/-4)
4 files modified
DistUpgrade/DistUpgradeCache.py (+1/-1)
DistUpgrade/DistUpgradeQuirks.py (+10/-1)
debian/changelog (+10/-0)
debian/python3-distupgrade.links (+0/-2)
To merge this branch: bzr merge lp:~barry/ubuntu-release-upgrader/lp1485093
Reviewer Review Type Date Requested Status
Ubuntu Core Development Team Pending
Review via email: mp+275096@code.launchpad.net

Description of the change

This fixes the imports to not be relative so that it's okay if the symlinks don't exist. Don't create the symlinks in the package install because if the dependent packages aren't installed, the symlinks will be dangling which breaks other packages, specifically pex's build.

Instead, just handle the ImportErrors that can happen if the dependent packages, imported via absolute path, don't exist.

To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :

This looks fine although, and I'll merge it at the start of X.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'DistUpgrade/DistUpgradeCache.py'
2--- DistUpgrade/DistUpgradeCache.py 2015-01-20 22:30:06 +0000
3+++ DistUpgrade/DistUpgradeCache.py 2015-10-20 20:08:36 +0000
4@@ -501,7 +501,7 @@
5 # if the free drivers would give us a equally hard time, we would
6 # never be able to release
7 try:
8- from .NvidiaDetector.nvidiadetector import NvidiaDetection
9+ from NvidiaDetector.nvidiadetector import NvidiaDetection
10 except (ImportError, SyntaxError) as e:
11 # SyntaxError is temporary until the port of NvidiaDetector to
12 # Python 3 is in the archive.
13
14=== modified file 'DistUpgrade/DistUpgradeQuirks.py'
15--- DistUpgrade/DistUpgradeQuirks.py 2015-01-20 22:44:02 +0000
16+++ DistUpgrade/DistUpgradeQuirks.py 2015-10-20 20:08:36 +0000
17@@ -32,7 +32,16 @@
18 from .utils import get_arch
19
20 from .DistUpgradeGettext import gettext as _
21-from .janitor.plugincore.manager import PluginManager
22+try:
23+ from janitor.plugincore.manager import PluginManager
24+except ImportError:
25+ # janitor is not available, so create a no-op plugin manager.
26+ class PluginManager(object):
27+ def __init__(self, *args, **kws):
28+ pass
29+
30+ def get_plugins(self, *args, **kws):
31+ return []
32
33
34 class DistUpgradeQuirks(object):
35
36=== modified file 'debian/changelog'
37--- debian/changelog 2015-10-20 15:56:29 +0000
38+++ debian/changelog 2015-10-20 20:08:36 +0000
39@@ -1,3 +1,13 @@
40+ubuntu-release-upgrader (1:15.10.14) wily; urgency=medium
41+
42+ * Don't try to import janitor and NvidiaDetector in a package relative
43+ to this one, to avoid the possibility of dangling symlinks when the
44+ packages actually containing these modules is not installed.
45+ (LP: #1485093)
46+ * debian/python3-distupgrade.links: Removed.
47+
48+ -- Barry Warsaw <barry@ubuntu.com> Fri, 16 Oct 2015 17:51:27 -0400
49+
50 ubuntu-release-upgrader (1:15.10.13) wily; urgency=medium
51
52 * Revert change from 15.10.11, already rejected from wily-proposed
53
54=== removed file 'debian/python3-distupgrade.links'
55--- debian/python3-distupgrade.links 2012-07-13 17:51:44 +0000
56+++ debian/python3-distupgrade.links 1970-01-01 00:00:00 +0000
57@@ -1,2 +0,0 @@
58-usr/lib/python3/dist-packages/janitor usr/lib/python3/dist-packages/DistUpgrade/janitor
59-usr/lib/python3/dist-packages/NvidiaDetector usr/lib/python3/dist-packages/DistUpgrade/NvidiaDetector

Subscribers

People subscribed via source and target branches