Merge lp:~cjwatson/launchpad/remove-data-tar-xz-version-requirement into lp:launchpad

Proposed by Colin Watson
Status: Merged
Approved by: Brad Crittenden
Approved revision: no longer in the source branch.
Merged at revision: 15176
Proposed branch: lp:~cjwatson/launchpad/remove-data-tar-xz-version-requirement
Merge into: lp:launchpad
Diff against target: 106 lines (+3/-71)
2 files modified
lib/lp/archiveuploader/nascentuploadfile.py (+0/-41)
lib/lp/archiveuploader/tests/test_nascentuploadfile.py (+3/-30)
To merge this branch: bzr merge lp:~cjwatson/launchpad/remove-data-tar-xz-version-requirement
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+103859@code.launchpad.net

Commit message

Now that Ubuntu 12.04 LTS has been released, we no longer need to check Pre-Depends for data.tar.xz uploads to ensure safe upgrades.

Description of the change

== Summary ==

In bug 619152, I added data.tar.xz upload support to Launchpad, and in https://code.launchpad.net/~cjwatson/launchpad/dpkg-xz-support-619152/+merge/32868 I noted "In order to make sure that upgrades work properly, we need to enforce a Pre-Depends on a new enough version of dpkg in packages using this, at least until the next LTS release". Now that we've had that LTS release, it is safe to drop the Pre-Depends check and the associated tests, so that we can drop various deltas against Debian.

== Tests ==

bin/test -vvct test_nascentuploadfile

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) wrote :

Hi Colin,

Thanks for remembering to make this change and doing so in such a timely manner.

In the test you restored, test_verifyFormat_xz_good_predep, is it still necessary to have the 'Pre-Depends' in the control in order for the upload to be accepted? Perhaps you can keep the test, though rename it, and remove the dependencies that are made obsolete by your branch.

Once ready I'll be happy to land it for you.

Normally I'd mark this as 'Approved' but this time I'm setting it to 'Needs fixing' as a reminder that I need to revisit it when you've made the change and then land it.

review: Needs Fixing (code)
Revision history for this message
Colin Watson (cjwatson) wrote :

On Fri, Apr 27, 2012 at 02:05:21PM -0000, Brad Crittenden wrote:
> In the test you restored, test_verifyFormat_xz_good_predep, is it
> still necessary to have the 'Pre-Depends' in the control in order for
> the upload to be accepted? Perhaps you can keep the test, though
> rename it, and remove the dependencies that are made obsolete by your
> branch.

It isn't necessary to have the Pre-Depends any more, no. I've pushed a
change that removes it. How's that?

> Once ready I'll be happy to land it for you.
>
> Normally I'd mark this as 'Approved' but this time I'm setting it to
> 'Needs fixing' as a reminder that I need to revisit it when you've
> made the change and then land it.

Thanks. I have PQM access these days, though, so all I need is for a
member of ~launchpad to set the MP status to Approved when you're happy
and then I can land it myself.

Revision history for this message
Brad Crittenden (bac) wrote :

That looks great Colin. Good news about you being able to commit.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/archiveuploader/nascentuploadfile.py'
2--- lib/lp/archiveuploader/nascentuploadfile.py 2012-02-21 22:46:28 +0000
3+++ lib/lp/archiveuploader/nascentuploadfile.py 2012-04-27 14:23:20 +0000
4@@ -711,47 +711,6 @@
5 "data.tar.bz2, data.tar.lzma or data.tar.xz." %
6 (self.filename, data_tar))
7
8- # xz-compressed debs must pre-depend on dpkg >= 1.15.6~.
9- XZ_REQUIRED_DPKG_VER = '1.15.6~'
10- if data_tar == "data.tar.xz":
11- parsed_deps = []
12- try:
13- parsed_deps = apt_pkg.parse_depends(
14- self.control['Pre-Depends'])
15- except (ValueError, TypeError):
16- yield UploadError(
17- "Can't parse Pre-Depends in the control file.")
18- return
19- except KeyError:
20- # Go past the for loop and yield the error below.
21- pass
22-
23- for token in parsed_deps:
24- try:
25- name, version, relation = token[0]
26- except ValueError:
27- yield("APT error processing token '%r' from Pre-Depends.")
28- return
29-
30- if name == 'dpkg':
31- # VersionCompare returns values similar to cmp;
32- # negative if first < second, zero if first ==
33- # second and positive if first > second.
34- if apt_pkg.version_compare(
35- version, XZ_REQUIRED_DPKG_VER) >= 0:
36- # Pre-Depends dpkg is fine.
37- return
38- else:
39- yield UploadError(
40- "Pre-Depends dpkg version should be >= %s "
41- "when using xz compression." %
42- XZ_REQUIRED_DPKG_VER)
43- return
44-
45- yield UploadError(
46- "Require Pre-Depends: dpkg (>= %s) when using xz "
47- "compression." % XZ_REQUIRED_DPKG_VER)
48-
49 def verifyDebTimestamp(self):
50 """Check specific DEB format timestamp checks."""
51 self.logger.debug("Verifying timestamps in %s" % (self.filename))
52
53=== modified file 'lib/lp/archiveuploader/tests/test_nascentuploadfile.py'
54--- lib/lp/archiveuploader/tests/test_nascentuploadfile.py 2012-01-01 02:58:52 +0000
55+++ lib/lp/archiveuploader/tests/test_nascentuploadfile.py 2012-04-27 14:23:20 +0000
56@@ -1,4 +1,4 @@
57-# Copyright 2010 Canonical Ltd. This software is licensed under the
58+# Copyright 2010-2012 Canonical Ltd. This software is licensed under the
59 # GNU Affero General Public License version 3 (see the file LICENSE).
60
61 """Test NascentUploadFile functionality."""
62@@ -325,42 +325,15 @@
63 self.assertEquals("0.42", uploadfile.source_version)
64 self.assertEquals("0.42", uploadfile.control_version)
65
66- def test_verifyFormat_xz_good_predep(self):
67- # verifyFormat accepts xz-compressed .debs with a sufficient dpkg
68- # pre-dependency.
69+ def test_verifyFormat_xz(self):
70+ # verifyFormat accepts xz-compressed .debs.
71 uploadfile = self.createDebBinaryUploadFile(
72 "foo_0.42_i386.deb", "main/python", "unknown", "mypkg", "0.42",
73 None, data_format="xz")
74 control = self.getBaseControl()
75- control["Pre-Depends"] = "dpkg (>= 1.15.6~)"
76 uploadfile.parseControl(control)
77 self.assertEqual([], list(uploadfile.verifyFormat()))
78
79- def test_verifyFormat_xz_bad_predep(self):
80- # verifyFormat rejects xz-compressed .debs with an insufficient dpkg
81- # pre-dependency.
82- uploadfile = self.createDebBinaryUploadFile(
83- "foo_0.42_i386.deb", "main/python", "unknown", "mypkg", "0.42",
84- None, data_format="xz")
85- control = self.getBaseControl()
86- control["Pre-Depends"] = "dpkg (>= 1.15.5)"
87- uploadfile.parseControl(control)
88- errors = list(uploadfile.verifyFormat())
89- self.assertEqual(1, len(errors))
90- self.assertIsInstance(errors[0], UploadError)
91-
92- def test_verifyFormat_xz_no_predep(self):
93- # verifyFormat rejects xz-compressed .debs with no dpkg
94- # pre-dependency.
95- uploadfile = self.createDebBinaryUploadFile(
96- "foo_0.42_i386.deb", "main/python", "unknown", "mypkg", "0.42",
97- None, data_format="xz")
98- control = self.getBaseControl()
99- uploadfile.parseControl(control)
100- errors = list(uploadfile.verifyFormat())
101- self.assertEqual(1, len(errors))
102- self.assertIsInstance(errors[0], UploadError)
103-
104 def test_storeInDatabase(self):
105 # storeInDatabase creates a BinaryPackageRelease.
106 uploadfile = self.createDebBinaryUploadFile(