Merge lp:~cjwatson/launchpad/remove-single-custom-upload-exception into lp:launchpad

Proposed by Colin Watson
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 15501
Proposed branch: lp:~cjwatson/launchpad/remove-single-custom-upload-exception
Merge into: lp:launchpad
Diff against target: 60 lines (+18/-18)
2 files modified
lib/lp/archiveuploader/nascentupload.py (+10/-15)
lib/lp/archiveuploader/tests/test_ppauploadprocessor.py (+8/-3)
To merge this branch: bzr merge lp:~cjwatson/launchpad/remove-single-custom-upload-exception
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+112093@code.launchpad.net

Commit message

Remove "single custom upload" hack: it was profoundly evil and is no longer used.

Description of the change

There is an ancient squamous horror lurking at the heart of archiveuploader: uploads that consist of a single custom file bypass the upload policy checks and thus may entirely lack a source package. Aside from being profoundly bad and wrong, this makes it impossible to do various useful things with these uploads, such as copy them around between pockets.

The only use of this was for translated package descriptions, and Michael Vogt has now amended his scripts to produce a proper source package instead. We should therefore close this loophole before some enterprising soul finds a new use for it.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
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/nascentupload.py'
2--- lib/lp/archiveuploader/nascentupload.py 2012-01-05 11:48:27 +0000
3+++ lib/lp/archiveuploader/nascentupload.py 2012-06-26 16:53:29 +0000
4@@ -165,21 +165,16 @@
5 for uploaded_file in self.changes.files:
6 self.run_and_collect_errors(uploaded_file.verify)
7
8- if (len(self.changes.files) == 1 and
9- isinstance(self.changes.files[0], CustomUploadFile)):
10- self.logger.debug("Single Custom Upload detected.")
11- else:
12- policy.validateUploadType(self)
13-
14- if self.sourceful and not self.changes.dsc:
15- self.reject(
16- "Unable to find the DSC file in the source upload.")
17-
18- # Apply the overrides from the database. This needs to be done
19- # before doing component verifications because the component
20- # actually comes from overrides for packages that are not NEW.
21- self.find_and_apply_overrides()
22- self._overrideDDEBSs()
23+ policy.validateUploadType(self)
24+
25+ if self.sourceful and not self.changes.dsc:
26+ self.reject("Unable to find the DSC file in the source upload.")
27+
28+ # Apply the overrides from the database. This needs to be done
29+ # before doing component verifications because the component
30+ # actually comes from overrides for packages that are not NEW.
31+ self.find_and_apply_overrides()
32+ self._overrideDDEBSs()
33
34 # Override archive location if necessary.
35 self.overrideArchive()
36
37=== modified file 'lib/lp/archiveuploader/tests/test_ppauploadprocessor.py'
38--- lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2012-01-20 16:11:11 +0000
39+++ lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2012-06-26 16:53:29 +0000
40@@ -660,12 +660,17 @@
41
42 :return: The queue items that were uploaded.
43 """
44- test_files_dir = os.path.join(config.root,
45- "lib/lp/archiveuploader/tests/data/")
46+ upload_dir = self.queueUpload("bar_1.0-1", "~name16/ubuntu")
47+ self.processUpload(self.uploadprocessor, upload_dir)
48+ [build] = self.name16.archive.getBuildRecords(name="bar")
49+
50+ test_files_dir = os.path.join(
51+ config.root, "lib/lp/archiveuploader/tests/data/")
52+ self.options.context = "buildd"
53 upload_dir = self.queueUpload(
54 "debian-installer", "~name16/ubuntu/breezy",
55 test_files_dir=test_files_dir)
56- self.processUpload(self.uploadprocessor, upload_dir)
57+ self.processUpload(self.build_uploadprocessor, upload_dir, build=build)
58
59 queue_items = self.breezy.getPackageUploads(
60 name=u"debian-installer",