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
=== modified file 'lib/lp/archiveuploader/nascentupload.py'
--- lib/lp/archiveuploader/nascentupload.py 2012-01-05 11:48:27 +0000
+++ lib/lp/archiveuploader/nascentupload.py 2012-06-26 16:53:29 +0000
@@ -165,21 +165,16 @@
165 for uploaded_file in self.changes.files:165 for uploaded_file in self.changes.files:
166 self.run_and_collect_errors(uploaded_file.verify)166 self.run_and_collect_errors(uploaded_file.verify)
167167
168 if (len(self.changes.files) == 1 and168 policy.validateUploadType(self)
169 isinstance(self.changes.files[0], CustomUploadFile)):169
170 self.logger.debug("Single Custom Upload detected.")170 if self.sourceful and not self.changes.dsc:
171 else:171 self.reject("Unable to find the DSC file in the source upload.")
172 policy.validateUploadType(self)172
173173 # Apply the overrides from the database. This needs to be done
174 if self.sourceful and not self.changes.dsc:174 # before doing component verifications because the component
175 self.reject(175 # actually comes from overrides for packages that are not NEW.
176 "Unable to find the DSC file in the source upload.")176 self.find_and_apply_overrides()
177177 self._overrideDDEBSs()
178 # Apply the overrides from the database. This needs to be done
179 # before doing component verifications because the component
180 # actually comes from overrides for packages that are not NEW.
181 self.find_and_apply_overrides()
182 self._overrideDDEBSs()
183178
184 # Override archive location if necessary.179 # Override archive location if necessary.
185 self.overrideArchive()180 self.overrideArchive()
186181
=== modified file 'lib/lp/archiveuploader/tests/test_ppauploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2012-01-20 16:11:11 +0000
+++ lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2012-06-26 16:53:29 +0000
@@ -660,12 +660,17 @@
660660
661 :return: The queue items that were uploaded.661 :return: The queue items that were uploaded.
662 """662 """
663 test_files_dir = os.path.join(config.root,663 upload_dir = self.queueUpload("bar_1.0-1", "~name16/ubuntu")
664 "lib/lp/archiveuploader/tests/data/")664 self.processUpload(self.uploadprocessor, upload_dir)
665 [build] = self.name16.archive.getBuildRecords(name="bar")
666
667 test_files_dir = os.path.join(
668 config.root, "lib/lp/archiveuploader/tests/data/")
669 self.options.context = "buildd"
665 upload_dir = self.queueUpload(670 upload_dir = self.queueUpload(
666 "debian-installer", "~name16/ubuntu/breezy",671 "debian-installer", "~name16/ubuntu/breezy",
667 test_files_dir=test_files_dir)672 test_files_dir=test_files_dir)
668 self.processUpload(self.uploadprocessor, upload_dir)673 self.processUpload(self.build_uploadprocessor, upload_dir, build=build)
669674
670 queue_items = self.breezy.getPackageUploads(675 queue_items = self.breezy.getPackageUploads(
671 name=u"debian-installer",676 name=u"debian-installer",