Merge lp:~andrewsomething/ubuntu-release-upgrader/lp1199157 into lp:ubuntu-release-upgrader

Proposed by Andrew Starr-Bochicchio
Status: Merged
Merged at revision: 2649
Proposed branch: lp:~andrewsomething/ubuntu-release-upgrader/lp1199157
Merge into: lp:ubuntu-release-upgrader
Diff against target: 87 lines (+45/-1)
4 files modified
DistUpgrade/DistUpgradeController.py (+11/-1)
debian/changelog (+6/-0)
tests/data-sources-list-test/sources.list.proposed_enabled (+5/-0)
tests/test_sources_list.py (+23/-0)
To merge this branch: bzr merge lp:~andrewsomething/ubuntu-release-upgrader/lp1199157
Reviewer Review Type Date Requested Status
Brian Murray Approve
Review via email: mp+173611@code.launchpad.net

Description of the change

Disable proposed on upgrade to a development release.

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

This looks good but I also think it would help if entry.comment were used which I believe will add a comment to the entry in sources.list. That way if somebody is inspecting the file they will have an idea as to why it was commented out.

Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote :

Makes sense. Should it also change entry.dist even though it's disabling it?

2649. By Andrew Starr-Bochicchio

Check first if the entry is already disabled and add a comment when disabling.

Revision history for this message
Brian Murray (brian-murray) wrote :

Yes, that is what happens in test_private_ppa_transition so that makes sense too. Thanks for working on this!

2650. By Andrew Starr-Bochicchio

Update entry.dist even though we disable it to be consistent with other entrys that get disabled.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

I tend to go on a re-enable spree after do-release-upgrade.
Can the comment, perhaps, have a more warning tone?

"Not for humans during development stage of release %s."

2651. By Andrew Starr-Bochicchio

Paint the bikeshed a brighter red.

Revision history for this message
Brian Murray (brian-murray) wrote :

This is great, thanks for your investigation into this issue and your fix.

review: Approve
Revision history for this message
Adolfo Jayme Barrientos (fitojb) wrote :

In the string "Not for humans during development stage of release %s" I think the word "users" fits better than "humans"...

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 2013-05-07 15:48:46 +0000
3+++ DistUpgrade/DistUpgradeController.py 2013-07-09 02:16:27 +0000
4@@ -633,7 +633,17 @@
5 logging.debug("commenting landscape.canonical.com out")
6 entry.disabled = True
7 continue
8-
9+
10+ # Disable proposed on upgrade to a development release.
11+ if (not entry.disabled and self.options
12+ and self.options.devel_release == True and
13+ "%s-proposed" % self.fromDist in entry.dist):
14+ logging.debug("upgrade to development release, disabling proposed")
15+ entry.dist = "%s-proposed" % self.toDist
16+ entry.comment += _("Not for humans during development stage of release %s") % self.toDist
17+ entry.disabled = True
18+ continue
19+
20 # handle upgrades from a EOL release and check if there
21 # is a supported release available
22 if (not entry.disabled and
23
24=== modified file 'debian/changelog'
25--- debian/changelog 2013-05-29 15:16:22 +0000
26+++ debian/changelog 2013-07-09 02:16:27 +0000
27@@ -1,3 +1,9 @@
28+ubuntu-release-upgrader (1:0.197) UNRELEASED; urgency=low
29+
30+ * Disable proposed on upgrade to a development release (LP: #1199157).
31+
32+ -- Andrew Starr-Bochicchio <a.starr.b@gmail.com> Mon, 08 Jul 2013 18:12:06 -0400
33+
34 ubuntu-release-upgrader (1:0.196) saucy; urgency=low
35
36 * Re-sync the local copy of invoke-rc.d with the one from sysvinit.
37
38=== added file 'tests/data-sources-list-test/sources.list.proposed_enabled'
39--- tests/data-sources-list-test/sources.list.proposed_enabled 1970-01-01 00:00:00 +0000
40+++ tests/data-sources-list-test/sources.list.proposed_enabled 2013-07-09 02:16:27 +0000
41@@ -0,0 +1,5 @@
42+deb http://archive.ubuntu.com/ubuntu feisty main restricted
43+deb http://archive.ubuntu.com/ubuntu feisty-updates main restricted
44+deb http://security.ubuntu.com/ubuntu/ feisty-security main restricted
45+deb http://archive.ubuntu.com/ubuntu feisty-proposed universe main multiverse restricted
46+
47
48=== modified file 'tests/test_sources_list.py'
49--- tests/test_sources_list.py 2012-12-14 10:47:33 +0000
50+++ tests/test_sources_list.py 2013-07-09 02:16:27 +0000
51@@ -17,6 +17,7 @@
52 from DistUpgrade import DistUpgradeConfigParser
53 from DistUpgrade.utils import url_downloadable
54 import logging
55+import mock
56
57 DistUpgradeConfigParser.CONFIG_OVERRIDE_DIR = None
58
59@@ -402,6 +403,28 @@
60 deb http://archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
61 """)
62
63+ def test_disable_proposed(self):
64+ """
65+ Test that proposed is disabled when upgrading to a development release.
66+ """
67+ shutil.copy(os.path.join(self.testdir, "sources.list.proposed_enabled"),
68+ os.path.join(self.testdir, "sources.list"))
69+ apt_pkg.config.set("Dir::Etc::sourcelist", "sources.list")
70+ v = DistUpgradeViewNonInteractive()
71+ options = mock.Mock()
72+ options.devel_release = True
73+ d = DistUpgradeController(v, options, datadir=self.testdir)
74+ d.openCache(lock=False)
75+ res = d.updateSourcesList()
76+ self.assertTrue(res)
77+
78+ self._verifySources("""
79+deb http://archive.ubuntu.com/ubuntu gutsy main restricted
80+deb http://archive.ubuntu.com/ubuntu gutsy-updates main restricted
81+deb http://security.ubuntu.com/ubuntu/ gutsy-security main restricted
82+# deb http://archive.ubuntu.com/ubuntu gutsy-proposed universe main multiverse restricted #Not for humans during development stage of release gutsy
83+""")
84+
85 def _verifySources(self, expected):
86 sources_file = apt_pkg.config.find_file("Dir::Etc::sourcelist")
87 sources_list = open(sources_file).read()

Subscribers

People subscribed via source and target branches