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
=== modified file 'DistUpgrade/DistUpgradeController.py'
--- DistUpgrade/DistUpgradeController.py 2013-05-07 15:48:46 +0000
+++ DistUpgrade/DistUpgradeController.py 2013-07-09 02:16:27 +0000
@@ -633,7 +633,17 @@
633 logging.debug("commenting landscape.canonical.com out")633 logging.debug("commenting landscape.canonical.com out")
634 entry.disabled = True634 entry.disabled = True
635 continue635 continue
636 636
637 # Disable proposed on upgrade to a development release.
638 if (not entry.disabled and self.options
639 and self.options.devel_release == True and
640 "%s-proposed" % self.fromDist in entry.dist):
641 logging.debug("upgrade to development release, disabling proposed")
642 entry.dist = "%s-proposed" % self.toDist
643 entry.comment += _("Not for humans during development stage of release %s") % self.toDist
644 entry.disabled = True
645 continue
646
637 # handle upgrades from a EOL release and check if there647 # handle upgrades from a EOL release and check if there
638 # is a supported release available648 # is a supported release available
639 if (not entry.disabled and649 if (not entry.disabled and
640650
=== modified file 'debian/changelog'
--- debian/changelog 2013-05-29 15:16:22 +0000
+++ debian/changelog 2013-07-09 02:16:27 +0000
@@ -1,3 +1,9 @@
1ubuntu-release-upgrader (1:0.197) UNRELEASED; urgency=low
2
3 * Disable proposed on upgrade to a development release (LP: #1199157).
4
5 -- Andrew Starr-Bochicchio <a.starr.b@gmail.com> Mon, 08 Jul 2013 18:12:06 -0400
6
1ubuntu-release-upgrader (1:0.196) saucy; urgency=low7ubuntu-release-upgrader (1:0.196) saucy; urgency=low
28
3 * Re-sync the local copy of invoke-rc.d with the one from sysvinit.9 * Re-sync the local copy of invoke-rc.d with the one from sysvinit.
410
=== added file 'tests/data-sources-list-test/sources.list.proposed_enabled'
--- tests/data-sources-list-test/sources.list.proposed_enabled 1970-01-01 00:00:00 +0000
+++ tests/data-sources-list-test/sources.list.proposed_enabled 2013-07-09 02:16:27 +0000
@@ -0,0 +1,5 @@
1deb http://archive.ubuntu.com/ubuntu feisty main restricted
2deb http://archive.ubuntu.com/ubuntu feisty-updates main restricted
3deb http://security.ubuntu.com/ubuntu/ feisty-security main restricted
4deb http://archive.ubuntu.com/ubuntu feisty-proposed universe main multiverse restricted
5
06
=== modified file 'tests/test_sources_list.py'
--- tests/test_sources_list.py 2012-12-14 10:47:33 +0000
+++ tests/test_sources_list.py 2013-07-09 02:16:27 +0000
@@ -17,6 +17,7 @@
17from DistUpgrade import DistUpgradeConfigParser17from DistUpgrade import DistUpgradeConfigParser
18from DistUpgrade.utils import url_downloadable18from DistUpgrade.utils import url_downloadable
19import logging19import logging
20import mock
2021
21DistUpgradeConfigParser.CONFIG_OVERRIDE_DIR = None22DistUpgradeConfigParser.CONFIG_OVERRIDE_DIR = None
2223
@@ -402,6 +403,28 @@
402deb http://archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse403deb http://archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
403""")404""")
404405
406 def test_disable_proposed(self):
407 """
408 Test that proposed is disabled when upgrading to a development release.
409 """
410 shutil.copy(os.path.join(self.testdir, "sources.list.proposed_enabled"),
411 os.path.join(self.testdir, "sources.list"))
412 apt_pkg.config.set("Dir::Etc::sourcelist", "sources.list")
413 v = DistUpgradeViewNonInteractive()
414 options = mock.Mock()
415 options.devel_release = True
416 d = DistUpgradeController(v, options, datadir=self.testdir)
417 d.openCache(lock=False)
418 res = d.updateSourcesList()
419 self.assertTrue(res)
420
421 self._verifySources("""
422deb http://archive.ubuntu.com/ubuntu gutsy main restricted
423deb http://archive.ubuntu.com/ubuntu gutsy-updates main restricted
424deb http://security.ubuntu.com/ubuntu/ gutsy-security main restricted
425# deb http://archive.ubuntu.com/ubuntu gutsy-proposed universe main multiverse restricted #Not for humans during development stage of release gutsy
426""")
427
405 def _verifySources(self, expected):428 def _verifySources(self, expected):
406 sources_file = apt_pkg.config.find_file("Dir::Etc::sourcelist")429 sources_file = apt_pkg.config.find_file("Dir::Etc::sourcelist")
407 sources_list = open(sources_file).read()430 sources_list = open(sources_file).read()

Subscribers

People subscribed via source and target branches