Merge lp:~allenap/launchpad/ddebs-n-udebs-go-shopping-bug-886452 into lp:launchpad

Proposed by Gavin Panella
Status: Merged
Approved by: Julian Edwards
Approved revision: no longer in the source branch.
Merged at revision: 14418
Proposed branch: lp:~allenap/launchpad/ddebs-n-udebs-go-shopping-bug-886452
Merge into: lp:launchpad
Prerequisite: lp:~allenap/launchpad/test-file-creation-oneiric-bug-892955
Diff against target: 45 lines (+9/-4)
2 files modified
lib/lp/archiveuploader/nascentupload.py (+6/-3)
lib/lp/archiveuploader/tests/test_nascentupload.py (+3/-1)
To merge this branch: bzr merge lp:~allenap/launchpad/ddebs-n-udebs-go-shopping-bug-886452
Reviewer Review Type Date Requested Status
Julian Edwards (community) Approve
Raphaël Badin Pending
Review via email: mp+83958@code.launchpad.net

This proposal supersedes a proposal from 2011-11-28.

Commit message

[r=julian-edwards][bug=886452] Match ddebs with udebs as well as debs.

To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote : Posted in a previous version of this proposal

Told you it was easy :)

Thanks for the cleanup too!

review: Approve
Revision history for this message
Gavin Panella (allenap) wrote : Posted in a previous version of this proposal

Julian, I got a weird test failure in this branch which doesn't appear to be related to my change. Nevertheless, I've had a stab at fixing it, though I'm not sure that my solution is the best way to do so. Please could you look at the changes I made to test_twistedsftp.py?

Revision history for this message
Julian Edwards (julian-edwards) wrote : Posted in a previous version of this proposal

You're right, it's completely unrelated, and I've no idea why it would fail. I must admit I don't like the change to the test, it's masking (pun intended) the problem.

Does it fail locally or only in ec2?

Revision history for this message
Gavin Panella (allenap) wrote : Posted in a previous version of this proposal

On 30 November 2011 09:13, Julian Edwards <...> wrote:
> You're right, it's completely unrelated, and I've no idea why it
> would fail.  I must admit I don't like the change to the test, it's
> masking (pun intended) the problem.

If the original test is correct, then I'll sort out the behaviour to
match that, probably by creating the file 0600 then resetting the
perms to 0644. I assume it is correct, but can you confirm?

> Does it fail locally or only in ec2?

Both! Very puzzling.

Thanks, Gavin.

Revision history for this message
Julian Edwards (julian-edwards) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/archiveuploader/nascentupload.py'
2--- lib/lp/archiveuploader/nascentupload.py 2011-10-25 11:44:47 +0000
3+++ lib/lp/archiveuploader/nascentupload.py 2011-11-30 16:31:53 +0000
4@@ -33,6 +33,7 @@
5 DdebBinaryUploadFile,
6 DebBinaryUploadFile,
7 SourceUploadFile,
8+ UdebBinaryUploadFile,
9 UploadError,
10 UploadWarning,
11 )
12@@ -348,9 +349,11 @@
13 unmatched_ddebs[ddeb_key] = uploaded_file
14
15 for uploaded_file in self.changes.files:
16- # We need exactly a DEB, not a DDEB.
17- if (isinstance(uploaded_file, DebBinaryUploadFile) and
18- not isinstance(uploaded_file, DdebBinaryUploadFile)):
19+ is_deb = isinstance(uploaded_file, DebBinaryUploadFile)
20+ is_udeb = isinstance(uploaded_file, UdebBinaryUploadFile)
21+ is_ddeb = isinstance(uploaded_file, DdebBinaryUploadFile)
22+ # We need exactly a DEB or UDEB, not a DDEB.
23+ if (is_deb or is_udeb) and not is_ddeb:
24 try:
25 matching_ddeb = unmatched_ddebs.pop(
26 (uploaded_file.package + '-dbgsym',
27
28=== modified file 'lib/lp/archiveuploader/tests/test_nascentupload.py'
29--- lib/lp/archiveuploader/tests/test_nascentupload.py 2011-10-19 11:09:38 +0000
30+++ lib/lp/archiveuploader/tests/test_nascentupload.py 2011-11-30 16:31:53 +0000
31@@ -1,4 +1,4 @@
32-# Copyright 2010 Canonical Ltd. This software is licensed under the
33+# Copyright 2010-2011 Canonical Ltd. This software is licensed under the
34 # GNU Affero General Public License version 3 (see the file LICENSE).
35
36 """Test NascentUpload functionality."""
37@@ -65,6 +65,8 @@
38 self.addFile('blah_1.0_all.deb')
39 self.addFile('libblah_1.0_i386.deb')
40 self.addFile('libblah-dbgsym_1.0_i386.ddeb')
41+ self.addFile('libfooble_1.0_i386.udeb')
42+ self.addFile('libfooble-dbgsym_1.0_i386.ddeb')
43 self.assertMatchDDEBErrors([])
44 self.assertIs(None, self.changes.files[0].ddeb_file)
45 self.assertIs(self.changes.files[2], self.changes.files[1].ddeb_file)