Merge lp:~feldgendler/update-manager/574436 into lp:update-manager

Proposed by Alexey Feldgendler
Status: Merged
Merged at revision: 2276
Proposed branch: lp:~feldgendler/update-manager/574436
Merge into: lp:update-manager
Diff against target: 68 lines (+17/-7)
1 file modified
DistUpgrade/DistUpgradeController.py (+17/-7)
To merge this branch: bzr merge lp:~feldgendler/update-manager/574436
Reviewer Review Type Date Requested Status
Michael Vogt Pending
Review via email: mp+82694@code.launchpad.net

Description of the change

Proposed fix for bug #574436

Introduced the [ThirdPartyMirrors] configuration section for the distribution upgrader. All keys in it must have distinct names, but only values matter. Each value is a third-party source URI. Such whitelisted sources don't get disabled on upgrade; however, if they use "from" release name, it's replaced with the "to" release name.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

On Fri, Nov 18, 2011 at 03:19:29PM -0000, Alexey Feldgendler wrote:
> Alexey Feldgendler has proposed merging lp:~feldgendler/update-manager/574436 into lp:update-manager.
>
> Requested reviews:
> Michael Vogt (mvo)
> Related bugs:
> Bug #574436 in update-manager (Ubuntu): "Third party software is uninstalled on upgrade"
> https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/574436
>
> For more details, see:
> https://code.launchpad.net/~feldgendler/update-manager/574436/+merge/82694
>
> Proposed fix for bug #574436
>
> Introduced the [ThirdPartyMirrors] configuration section for the distribution upgrader. All keys in it must have distinct names, but only values matter. Each value is a third-party source URI. Such whitelisted sources don't get disabled on upgrade; however, if they use "from" release name, it's replaced with the "to" release name.

Thanks, I merged this with a small tweak (see below).

> + self.valid_3p_mirrors = [pair[1] for pair in self.config.items('ThirdPartyMirrors')]

This needs to test that "thirdPartyMirrors" is part of the config,
otherwise it crashes. I fixed that during the merge and is part of
trunk now.

Thanks a lot for your work on this!
 Michael

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'DistUpgrade/DistUpgradeController.py'
2--- DistUpgrade/DistUpgradeController.py 2011-11-16 09:14:46 +0000
3+++ DistUpgrade/DistUpgradeController.py 2011-11-18 15:18:24 +0000
4@@ -167,6 +167,7 @@
5 self.forced_obsoletes = self.config.getlist("Distro","ForcedObsoletes")
6 # list of valid mirrors that we can add
7 self.valid_mirrors = self.config.getListFromFile("Sources","ValidMirrors")
8+ self.valid_3p_mirrors = [pair[1] for pair in self.config.items('ThirdPartyMirrors')]
9 # debugging
10 #apt_pkg.Config.set("DPkg::Options::","--debug=0077")
11
12@@ -603,8 +604,8 @@
13 logging.debug("examining: '%s'" % get_string_with_no_auth_from_source_entry(entry))
14 # check if it's a mirror (or official site)
15 validMirror = self.isMirror(entry.uri)
16- if validMirror or not mirror_check:
17- validMirror = True
18+ thirdPartyMirror = not mirror_check or self.isThirdPartyMirror(entry.uri)
19+ if validMirror or thirdPartyMirror:
20 # disabled/security/commercial/extras are special cases
21 # we use validTo/foundToDist to figure out if we have a
22 # main archive mirror in the sources.list or if we
23@@ -628,14 +629,14 @@
24 logging.debug("entry '%s' updated to new dist" % get_string_with_no_auth_from_source_entry(entry))
25 elif entry.type == 'deb-src':
26 continue
27- else:
28+ elif validMirror:
29 # disable all entries that are official but don't
30 # point to either "to" or "from" dist
31 entry.disabled = True
32 self.sources_disabled = True
33 logging.debug("entry '%s' was disabled (unknown dist)" % get_string_with_no_auth_from_source_entry(entry))
34
35- # if we make it to this point, we have a official mirror
36+ # if we make it to this point, we have a official or third-party mirror
37
38 # check if the arch is powerpc or sparc and if so, transition
39 # to ports.ubuntu.com (powerpc got demoted in gutsy, sparc
40@@ -660,9 +661,9 @@
41 if not comp in sync_components:
42 continue
43 self.found_components[d].add(comp)
44-
45- # disable anything that is not from a official mirror
46- if not validMirror:
47+
48+ else:
49+ # disable anything that is not from a official mirror or a whitelisted third party
50 if entry.dist == self.fromDist:
51 entry.dist = self.toDist
52 entry.comment += " " + _("disabled on upgrade to %s") % self.toDist
53@@ -1362,6 +1363,15 @@
54 return True
55 return False
56
57+ def isThirdPartyMirror(self, uri):
58+ " check if uri is a whitelisted third-party mirror "
59+ uri = uri.rstrip("/")
60+ for mirror in self.valid_3p_mirrors:
61+ mirror = mirror.rstrip("/")
62+ if is_mirror(mirror, uri):
63+ return True
64+ return False
65+
66 def _getPreReqMirrorLines(self, dumb=False):
67 " get sources.list snippet lines for the current mirror "
68 lines = ""

Subscribers

People subscribed via source and target branches

to status/vote changes: