launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #00682
[Merge] lp:~salgado/launchpad/drop-mixed-uploads into lp:launchpad/devel
Guilherme Salgado has proposed merging lp:~salgado/launchpad/drop-mixed-uploads into lp:launchpad/devel.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Change a bunch of tests that were doing mixed (source+binary) uploads to not
do so as soyuz should no longer accept them.
This is in preparation for the changes I'll do to make soyuz not accept mixed
uploads.
--
https://code.launchpad.net/~salgado/launchpad/drop-mixed-uploads/+merge/33210
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~salgado/launchpad/drop-mixed-uploads into lp:launchpad/devel.
=== added file 'lib/lp/archiveuploader/tests/data/ed_0.2-20_i386.changes.binary-only'
--- lib/lp/archiveuploader/tests/data/ed_0.2-20_i386.changes.binary-only 1970-01-01 00:00:00 +0000
+++ lib/lp/archiveuploader/tests/data/ed_0.2-20_i386.changes.binary-only 2010-08-20 13:31:08 +0000
@@ -0,0 +1,58 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+Format: 1.7
+Date: Wed, 2 Apr 2003 17:19:47 +0100
+Source: ed
+Binary: ed
+Architecture: i386
+Version: 0.2-20
+Distribution: unstable
+Urgency: low
+Maintainer: James Troup <james@xxxxxxxxxx>
+Changed-By: James Troup <james@xxxxxxxxxx>
+Description:
+ ed - The classic unix line editor
+Closes: 122517 130327 179957
+Changes:
+ ed (0.2-20) unstable; urgency=low
+ .
+ * Move to dpatch; existing non-debian/ changes split into
+ 01_buf.c-tmpfile, 02_-Wall-cleanup, 03_ed.1-cleanup and
+ 04_Makfile.in-no-libed.
+ * debian/rules: include /usr/share/dpatch/dpatch.make.
+ * debian/rules (build): depend on patch-stamp.
+ * debian/rules (clean): depend on unpatch. Remove debian/patched.
+ * debian/rules (.PHONY): add 'patch' and 'unpatch'.
+ * debian/control (Build-Depends): add dpatch.
+ .
+ * debian/rules: update copyright.
+ * debian/copyright: likewise and update upstream URL.
+ * debian/changelog: remove local-variables stuff.
+ .
+ * debian/rules: use install_foo convenience variables.
+ * debian/rules (clean): remove *~ in any subdirectory.
+ .
+ * debian/control (Standards-Version): bump to 3.5.8.0.
+ * debian/postinst, debian/prerm: no longer do /usr/doc symlinks.
+ .
+ * config, test/*: unused aegis cruft; removed.
+ * Undo s/%/$/ change in RCS keywords.
+ .
+ * debian/postinst: provide editor.1.gz alternative; thanks to Ben Harris
+ <bjh21@xxxxxxxxx> for the suggestion. Closes: #122517
+ * 05_ed.1-warning-fix.dpatch: new patch to avoid groff warnings. Thanks
+ to Colin Watson <cjwatson@xxxxxxxxxx>. Closes: #179957
+ * 06_testsuite-Makefile.dpatch: new patch to ensure the test suite bombs
+ out on errors. Thanks to Joel Baker <fenton@xxxxxxxxxx>.
+ Closes: #130327
+Files:
+ 379bf8c1d4fd2244d31851e15ee14ae0 46792 editors important ed_0.2-20_i386.deb
+
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.10 (GNU/Linux)
+
+iEYEARECAAYFAkxtm0cACgkQDjSYZ10UdUfw1ACfUl2/eg6Iq3nBqQYnSd8c+w1+
+2LMAoIcLJiv3Rl8P9+ezamw8pNN8IOF3
+=guXd
+-----END PGP SIGNATURE-----
=== modified file 'lib/lp/archiveuploader/tests/data/ed_0.2-20_i386.changes.mismatched-arch-unsigned'
--- lib/lp/archiveuploader/tests/data/ed_0.2-20_i386.changes.mismatched-arch-unsigned 2008-01-03 14:45:18 +0000
+++ lib/lp/archiveuploader/tests/data/ed_0.2-20_i386.changes.mismatched-arch-unsigned 2010-08-20 13:31:08 +0000
@@ -2,7 +2,7 @@
Date: Wed, 2 Apr 2003 17:19:47 +0100
Source: ed
Binary: ed
-Architecture: source amd64
+Architecture: amd64
Version: 0.2-20
Distribution: unstable
Urgency: low
@@ -44,7 +44,5 @@
out on errors. Thanks to Joel Baker <fenton@xxxxxxxxxx>.
Closes: #130327
Files:
- de8b206f8fc57bd931f6226feac6644a 578 editors important ed_0.2-20.dsc
- 8343836094fb01ee9b9a1067b23365f1 8600 editors important ed_0.2-20.diff.gz
379bf8c1d4fd2244d31851e15ee14ae0 46792 editors important ed_0.2-20_i386.deb
=== added file 'lib/lp/archiveuploader/tests/data/ed_0.2-20_source.changes'
--- lib/lp/archiveuploader/tests/data/ed_0.2-20_source.changes 1970-01-01 00:00:00 +0000
+++ lib/lp/archiveuploader/tests/data/ed_0.2-20_source.changes 2010-08-20 13:31:08 +0000
@@ -0,0 +1,59 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+Format: 1.7
+Date: Wed, 2 Apr 2003 17:19:47 +0100
+Source: ed
+Binary: ed
+Architecture: source
+Version: 0.2-20
+Distribution: unstable
+Urgency: low
+Maintainer: James Troup <james@xxxxxxxxxx>
+Changed-By: James Troup <james@xxxxxxxxxx>
+Description:
+ ed - The classic unix line editor
+Closes: 122517 130327 179957
+Changes:
+ ed (0.2-20) unstable; urgency=low
+ .
+ * Move to dpatch; existing non-debian/ changes split into
+ 01_buf.c-tmpfile, 02_-Wall-cleanup, 03_ed.1-cleanup and
+ 04_Makfile.in-no-libed.
+ * debian/rules: include /usr/share/dpatch/dpatch.make.
+ * debian/rules (build): depend on patch-stamp.
+ * debian/rules (clean): depend on unpatch. Remove debian/patched.
+ * debian/rules (.PHONY): add 'patch' and 'unpatch'.
+ * debian/control (Build-Depends): add dpatch.
+ .
+ * debian/rules: update copyright.
+ * debian/copyright: likewise and update upstream URL.
+ * debian/changelog: remove local-variables stuff.
+ .
+ * debian/rules: use install_foo convenience variables.
+ * debian/rules (clean): remove *~ in any subdirectory.
+ .
+ * debian/control (Standards-Version): bump to 3.5.8.0.
+ * debian/postinst, debian/prerm: no longer do /usr/doc symlinks.
+ .
+ * config, test/*: unused aegis cruft; removed.
+ * Undo s/%/$/ change in RCS keywords.
+ .
+ * debian/postinst: provide editor.1.gz alternative; thanks to Ben Harris
+ <bjh21@xxxxxxxxx> for the suggestion. Closes: #122517
+ * 05_ed.1-warning-fix.dpatch: new patch to avoid groff warnings. Thanks
+ to Colin Watson <cjwatson@xxxxxxxxxx>. Closes: #179957
+ * 06_testsuite-Makefile.dpatch: new patch to ensure the test suite bombs
+ out on errors. Thanks to Joel Baker <fenton@xxxxxxxxxx>.
+ Closes: #130327
+Files:
+ de8b206f8fc57bd931f6226feac6644a 578 editors important ed_0.2-20.dsc
+ 8343836094fb01ee9b9a1067b23365f1 8600 editors important ed_0.2-20.diff.gz
+ ddd57463774cae9b50e70cd51221281b 185913 editors important ed_0.2.orig.tar.gz
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.10 (GNU/Linux)
+
+iEYEARECAAYFAkxtmZUACgkQDjSYZ10UdUd0TwCeOumev3Nbm4G8z1yTefKt3Oo/
+IYQAoNL0W0/vEew0hIqf5nlxcs0e5KOC
+=RzNg
+-----END PGP SIGNATURE-----
=== modified file 'lib/lp/archiveuploader/tests/data/suite/foo_1.0-2_multi_binary/foo_1.0-2_i386.changes'
--- lib/lp/archiveuploader/tests/data/suite/foo_1.0-2_multi_binary/foo_1.0-2_i386.changes 2008-07-11 11:25:59 +0000
+++ lib/lp/archiveuploader/tests/data/suite/foo_1.0-2_multi_binary/foo_1.0-2_i386.changes 2010-08-20 13:31:08 +0000
@@ -2,7 +2,7 @@
Date: Thu, 16 Feb 2006 15:47:28 +0000
Source: foo
Binary: foo foo-dev
-Architecture: source i386
+Architecture: i386
Version: 1.0-2
Distribution: breezy
Urgency: low
@@ -16,8 +16,5 @@
.
* A version rev for joy's sake
Files:
- 74c1de307d849dc54bd390ab6ae7188f 284 devel optional foo_1.0-2.dsc
- 0982759bd29072e993c4e375769f6ff7 601 devel optional foo_1.0-2.diff.gz
15aaae6676d3d546d6ba69cf7d272875 642 devel optional foo_1.0-2_i386.deb
0afcb7d8a6ec16b954ee340fcdaf7644 652 devel optional foo-dev_1.0-2_i386.deb
- 4a7a1ab59ed8f9f1021825ba4b7ea826 160 devel optional foo_1.0.orig.tar.gz
=== modified file 'lib/lp/archiveuploader/tests/nascentupload-announcements.txt'
--- lib/lp/archiveuploader/tests/nascentupload-announcements.txt 2010-08-04 00:16:44 +0000
+++ lib/lp/archiveuploader/tests/nascentupload-announcements.txt 2010-08-20 13:31:08 +0000
@@ -834,71 +834,6 @@
>>> notification['Subject']
'[ubuntu/hoary-security] bar 1.0-2 (Accepted)'
-
-A mixed mode upload to the SECURITY pocket via the 'security' policy
-will generate a notification to the uploader and an announcement to
-the distroseries changes list.
-
-First, upload and accept foo_1.0-1_mixed to make 'foo' source
-and binary known in hoary, then our operations in post-release
-pockets can work:
-
- >>> hoary.status = SeriesStatus.DEVELOPMENT
- >>> modified_sync_policy = getPolicy(
- ... name='sync', distro='ubuntu', distroseries='hoary')
- >>> modified_sync_policy.can_upload_mixed = True
- >>> modified_sync_policy.can_upload_binaries = True
- >>> modified_sync_policy.can_upload_source = True
- >>> foo_v1 = NascentUpload.from_changesfile_path(
- ... datadir('suite/foo_1.0-1_mixed/foo_1.0-1_i386.changes'),
- ... modified_sync_policy, mock_logger_quiet)
- >>> foo_v1.process()
- >>> result = foo_v1.do_accept()
- >>> foo_v1.queue_root.setAccepted()
- >>> pub_records = foo_v1.queue_root.realiseUpload()
- >>> hoary.status = SeriesStatus.CURRENT
-
-Get rid of any emails generated:
-
- >>> msgs = pop_notifications()
-
-Now we can upload a security fix:
-
- >>> security_policy = getPolicy(
- ... name='security', distro='ubuntu', distroseries=None)
- >>> security_policy.setDistroSeriesAndPocket('hoary-security')
- >>> foo_mixed = NascentUpload.from_changesfile_path(
- ... datadir('suite/foo_1.0-2.1/foo_1.0-2.1_source.changes'),
- ... security_policy, mock_logger_quiet)
- >>> foo_mixed.process()
- >>> foo_mixed.logger = mock_logger
- >>> result = foo_mixed.do_accept()
- DEBUG: Creating queue entry
- ...
-
-Two emails generated:
-
- >>> msgs = pop_notifications(sort_key=operator.itemgetter('To'))
- >>> len(msgs)
- 2
-
- >>> [message['To'] for message in msgs]
- ['Daniel Silverstone <daniel.silverstone@xxxxxxxxxxxxx>',
- 'hoary-announce@xxxxxxxxxxxxxxxx']
-
- >>> [message['Subject'] for message in msgs]
- ['[ubuntu/hoary-security] foo 1.0-2.1 (Accepted)',
- '[ubuntu/hoary-security] foo 1.0-2.1 (Accepted)']
-
- >>> [message['X-Katie'] for message in msgs]
- ['Launchpad actually', 'Launchpad actually']
-
-Remove orig.tar.gz pumped from librarian to disk during the upload
-checks:
-
- >>> os.remove(os.path.join(datadir('suite/foo_1.0-2.1'),
- ... 'foo_1.0.orig.tar.gz'))
-
Dry run uploads should not generate any emails. Call do_accept with
notify=False:
@@ -933,7 +868,7 @@
dry_run, which when True will not send any emails. It will also log at
the INFO level what it /would/ have sent.
- >>> random_package_upload = hoary.getQueueItems()[2]
+ >>> random_package_upload = hoary.getQueueItems()[0]
>>> random_package_upload.notify(dry_run=True, logger=mock_logger)
DEBUG: Building recipients list.
...
=== modified file 'lib/lp/archiveuploader/tests/nascentupload.txt'
--- lib/lp/archiveuploader/tests/nascentupload.txt 2010-08-05 10:27:01 +0000
+++ lib/lp/archiveuploader/tests/nascentupload.txt 2010-08-20 13:31:08 +0000
@@ -213,13 +213,10 @@
files specified. For instance, the changesfile Architecture list line
should match the files target architectures:
-XXX cprov 20070404: we need to a policy that accepts unsigned
-changesfiles and binary, source and mixed uploads ...
-
+ # Use the buildd policy as it accepts unsigned changes files and binary
+ # uploads.
>>> modified_buildd_policy = getPolicy(
... name='buildd', distro='ubuntu', distroseries='hoary', buildid=1)
- >>> modified_buildd_policy.can_upload_source = True
- >>> modified_buildd_policy.can_upload_mixed = True
>>> ed_mismatched_upload = NascentUpload.from_changesfile_path(
... datadir("ed_0.2-20_i386.changes.mismatched-arch-unsigned"),
@@ -229,84 +226,70 @@
>>> for f in ed_mismatched_upload.changes.files:
... print f.filename, f
- ed_0.2-20.dsc <...DSCFile...>
- ed_0.2-20.diff.gz <...SourceUploadFile...>
ed_0.2-20_i386.deb <...DebBinaryUploadFile...>
>>> [a for a in ed_mismatched_upload.changes.architectures]
- ['source', 'amd64']
+ ['amd64']
-Since the changesfile specify that only 'source' (pseudo-architecture
-to represent source in debian format) and 'amd64' will be used and
+Since the changesfile specify that only 'amd64' will be used and
there is a file that depends on 'i386' the upload is rejected:
>>> print ed_mismatched_upload.rejection_message
ed_0.2-20_i386.deb: control file lists arch as 'i386' which isn't in the changes file.
-=== Mixed Uploads ===
-
-Uploads can also contain sources and binaries together and we call it
-'mixed' mode. This feature is specially useful for uploading security
-fixed into ubuntu since they are assembled and built in a external
-system.
-
-XXX cprov 20070404: we need a policy that accepts mixed uploads to
-RELEASE pocket ...
-
- >>> modified_insecure_policy = getPolicy(
+=== Uploads missing ORIG files ===
+
+Uploads don't need to include the ORIG files when they're known to be in the
+archive already.
+
+ >>> insecure_policy_changed = getPolicy(
... name='insecure', distro='ubuntu', distroseries='hoary')
- >>> modified_insecure_policy.can_upload_binaries = True
- >>> modified_insecure_policy.can_upload_mixed = True
-
- >>> ed_mixed_upload = NascentUpload.from_changesfile_path(
- ... datadir("ed_0.2-20_i386.changes"),
- ... modified_insecure_policy, mock_logger_quiet)
-
- >>> ed_mixed_upload.process()
- >>> ed_mixed_upload.is_rejected
- False
-
-The NascentUpload can tell us if it is sourceful or not, (ditto binaryful)
-
- >>> ed_mixed_upload.sourceful
- True
- >>> ed_mixed_upload.binaryful
- True
-
-Also provide architecture dependent status:
-
- >>> ed_mixed_upload.archindep
- False
- >>> ed_mixed_upload.archdep
- True
-
-This mixed upload explores another feature in Soyuz, it does not
-upload the ORIG files assuming it is already published by its
-ancestries (it saves a lot of bandwidth). So, the upload is not
-'native', neither 'hasorig':
-
- >>> has_native(ed_mixed_upload)
- False
- >>> has_orig(ed_mixed_upload)
+
+ # Copy the .orig so that NascentUpload has access to it, although it
+ # wouldn't have been uploaded in practice because (as you can see below) the
+ # .orig was not included in the .changes file.
+ >>> import shutil
+ >>> shutil.copy(datadir("ed_0.2.orig.tar.gz"), datadir("ed-0.2-21/"))
+
+ >>> ed_upload = NascentUpload.from_changesfile_path(
+ ... datadir("ed-0.2-21/ed_0.2-21_source.changes"),
+ ... insecure_policy_changed, mock_logger_quiet)
+
+ >>> ed_upload.process()
+ >>> ed_upload.is_rejected
+ False
+ >>> ed_upload.rejection_message
+ ''
+
+As we see here, the ORIG files were not included.
+
+ >>> has_orig(ed_upload)
+ False
+
+And because of that it's not considered native.
+
+ >>> has_native(ed_upload)
False
But if we check the DSC we will find the reference to the already
known ORIG file:
- >>> [f.filename for f in ed_mixed_upload.changes.dsc.files]
- ['ed_0.2.orig.tar.gz', 'ed_0.2-20.diff.gz']
+ >>> [f.filename for f in ed_upload.changes.dsc.files]
+ ['ed_0.2.orig.tar.gz', 'ed_0.2-21.diff.gz']
- >>> success = ed_mixed_upload.do_accept()
+ >>> success = ed_upload.do_accept()
>>> success
True
The notification message generated is described in more detail in
doc/nascentupload-announcements.txt.
-Roll back everything related with ed_mixed_upload:
+Roll back everything related with ed_upload:
>>> transaction.abort()
+ >>> import os
+ >>> os.remove(datadir("ed-0.2-21/ed_0.2.orig.tar.gz"))
== Acceptance Work-flow ==
=== modified file 'lib/lp/archiveuploader/tests/nascentuploadfile.txt'
--- lib/lp/archiveuploader/tests/nascentuploadfile.txt 2010-07-24 05:41:31 +0000
+++ lib/lp/archiveuploader/tests/nascentuploadfile.txt 2010-08-20 13:31:08 +0000
@@ -63,70 +63,77 @@
>>> modified_insecure_policy = getPolicy(
... name='insecure', distro='ubuntu', distroseries='hoary')
- >>> modified_insecure_policy.can_upload_binaries = True
- >>> modified_insecure_policy.can_upload_mixed = True
>>> from lp.archiveuploader.changesfile import ChangesFile
- >>> ed_mixed_changes = ChangesFile(
- ... datadir('ed_0.2-20_i386.changes'),
+ >>> ed_binary_changes = ChangesFile(
+ ... datadir('ed_0.2-20_i386.changes.binary-only'),
+ ... modified_insecure_policy, mock_logger_quiet)
+
+ >>> ed_source_changes = ChangesFile(
+ ... datadir('ed_0.2-20_source.changes'),
... modified_insecure_policy, mock_logger_quiet)
Make sure we are not getting any exceptions due to a malformed changes
file name.
- >>> len(list(ed_mixed_changes.checkFileName()))
+ >>> len(list(ed_binary_changes.checkFileName()))
0
At this point the changesfile content is already parsed:
- >>> ed_mixed_changes.source
+ >>> ed_binary_changes.source
'ed'
- >>> ed_mixed_changes.version
+ >>> ed_binary_changes.version
'0.2-20'
- >>> ed_mixed_changes.architectures
- set(['source', 'i386'])
+ >>> ed_binary_changes.architectures
+ set(['i386'])
- >>> ed_mixed_changes.suite_name
+ >>> ed_binary_changes.suite_name
'unstable'
Push upload targeted suite into policy before the checks, nomally done
by NascentUpload object:
>>> modified_insecure_policy.setDistroSeriesAndPocket(
- ... ed_mixed_changes.suite_name)
+ ... ed_binary_changes.suite_name)
Build contained objects, any error during this process will be stored
in the returned generator. This way all the checks are performed and
we can deal with the errors later:
- >>> errors = ed_mixed_changes.processFiles()
+ >>> errors = ed_binary_changes.processFiles()
>>> errors
<generator ...>
- >>> len(list(errors))
- 0
+ >>> list(errors)
+ []
+
+ >>> list(ed_source_changes.processFiles())
+ []
At this point we can inspect the list of files contained in the upload.
- >>> for uploaded_file in ed_mixed_changes.files:
+ >>> for uploaded_file in ed_binary_changes.files:
... print uploaded_file.filename
- ed_0.2-20.dsc
- ed_0.2-20.diff.gz
ed_0.2-20_i386.deb
- >>> [f.filename for f in ed_mixed_changes.binary_package_files]
+ >>> [f.filename for f in ed_binary_changes.binary_package_files]
['ed_0.2-20_i386.deb']
+ >>> [f.filename for f in ed_binary_changes.source_package_files]
+ []
- >>> [f.filename for f in ed_mixed_changes.source_package_files]
- ['ed_0.2-20.dsc', 'ed_0.2-20.diff.gz']
+ >>> [f.filename for f in ed_source_changes.binary_package_files]
+ []
+ >>> [f.filename for f in ed_source_changes.source_package_files]
+ ['ed_0.2-20.dsc', 'ed_0.2-20.diff.gz', 'ed_0.2.orig.tar.gz']
Similar to what we have in 'processFiles' ChangesFile.verify is also
a error generator
- >>> errors = ed_mixed_changes.verify()
+ >>> errors = ed_binary_changes.verify()
>>> len(list(errors))
0
@@ -135,7 +142,7 @@
We first create a misnamed copy of the changes file.
>>> import os, shutil
- >>> originalp = datadir('ed_0.2-20_i386.changes')
+ >>> originalp = datadir('ed_0.2-20_i386.changes.binary-only')
>>> copyp = datadir('p-m_0.4.12-2~ppa2.changes')
>>> shutil.copyfile(originalp, copyp)
@@ -187,19 +194,19 @@
sanity, it'll be done later on, this method only checks if the
section_name startswith 'raw-':
- >>> ed_mixed_changes.isCustom('foo-bar')
- False
- >>> ed_mixed_changes.isCustom('drops/foo-bar')
- False
- >>> ed_mixed_changes.isCustom('drops/raw-biscuit')
- True
- >>> ed_mixed_changes.isCustom('drops/rawbiscuit')
- False
- >>> ed_mixed_changes.isCustom('drops/raw-biscuit/something')
- True
- >>> ed_mixed_changes.isCustom('main/raw-installer')
- True
- >>> ed_mixed_changes.isCustom('main/law-installer')
+ >>> ed_binary_changes.isCustom('foo-bar')
+ False
+ >>> ed_binary_changes.isCustom('drops/foo-bar')
+ False
+ >>> ed_binary_changes.isCustom('drops/raw-biscuit')
+ True
+ >>> ed_binary_changes.isCustom('drops/rawbiscuit')
+ False
+ >>> ed_binary_changes.isCustom('drops/raw-biscuit/something')
+ True
+ >>> ed_binary_changes.isCustom('main/raw-installer')
+ True
+ >>> ed_binary_changes.isCustom('main/law-installer')
False
See the CustomUploadFile checks below for specific checks on custom
@@ -305,10 +312,10 @@
On ChangesFile objects we can have access to the enhanced address_structure
corresponding to the RFC-822 mentioned after performing 'processAddress':
- >>> ed_mixed_changes.maintainer is None
+ >>> ed_binary_changes.maintainer is None
True
- >>> errors = ed_mixed_changes.processAddresses()
+ >>> errors = ed_binary_changes.processAddresses()
>>> len(list(errors))
0
@@ -317,15 +324,15 @@
The built address_structure contains values that will be used during
the upload processing:
- >>> ed_mixed_changes.maintainer['rfc822']
- 'James Troup <james@xxxxxxxxxx>'
- >>> ed_mixed_changes.maintainer['rfc2047']
- 'James Troup <james@xxxxxxxxxx>'
- >>> ed_mixed_changes.maintainer['name']
+ >>> ed_binary_changes.maintainer['rfc822']
+ 'James Troup <james@xxxxxxxxxx>'
+ >>> ed_binary_changes.maintainer['rfc2047']
+ 'James Troup <james@xxxxxxxxxx>'
+ >>> ed_binary_changes.maintainer['name']
'James Troup'
- >>> ed_mixed_changes.maintainer['email']
+ >>> ed_binary_changes.maintainer['email']
'james@xxxxxxxxxx'
- >>> ed_mixed_changes.maintainer['person']
+ >>> ed_binary_changes.maintainer['person']
<Person ...>
@@ -338,18 +345,18 @@
The ChangesFile signer IPerson, used to checks upload ACL, normally
know as 'sponsor' or 'mentor':
- >>> ed_mixed_changes.signer.displayname
+ >>> ed_binary_changes.signer.displayname
u'Foo Bar'
The IGPGKey used to sign this ChangesFile:
- >>> ed_mixed_changes.signingkey.displayname
- u'1024D/6C64A8C5'
+ >>> ed_binary_changes.signingkey.displayname
+ u'1024D/5D147547'
The IGPGKey fingerprint used to sign this ChangesFile:
- >>> print ed_mixed_changes.fingerprint
- 340CA3BB270E2716C9EE0B768E7EB7086C64A8C5
+ >>> print ed_binary_changes.fingerprint
+ FD311613D941C6DE55737D310E3498675D147547
== DSCFile ==
@@ -363,60 +370,60 @@
>>> from lp.archiveuploader.dscfile import (
... DSCFile, DSCUploadedFile)
- >>> ed_mixed_dsc = DSCFile(
+ >>> ed_source_dsc = DSCFile(
... datadir('ed_0.2-20.dsc'),
... 'de8b206f8fc57bd931f6226feac6644a', 578, 'editors',
- ... 'important', 'ed', '0.2-20', ed_mixed_changes,
+ ... 'important', 'ed', '0.2-20', ed_source_changes,
... modified_insecure_policy, mock_logger_quiet)
- >>> ed_mixed_dsc
+ >>> ed_source_dsc
<lp.archiveuploader.dscfile.DSCFile ...>
So this object is exactly the same than what we already have created
in the ChangesFile instance.
- >>> ed_mixed_changes.dsc
+ >>> ed_source_changes.dsc
<lp.archiveuploader.dscfile.DSCFile ...>
The DSCFile also presents a similar behaviour to access its parsed
contents:
- >>> ed_mixed_dsc.source
+ >>> ed_source_dsc.source
'ed'
- >>> ed_mixed_dsc.version
+ >>> ed_source_dsc.version
'0.2-20'
- >>> ed_mixed_dsc.architecture
+ >>> ed_source_dsc.architecture
'any'
- >>> ed_mixed_dsc.binary
+ >>> ed_source_dsc.binary
'ed'
The DSC is GPG-signed most of the time, so we can guarantee who was
the author. The DSCFile class implements the same address parsing
methods found in ChangesFile:
- >>> ed_mixed_dsc.maintainer['rfc822']
+ >>> ed_source_dsc.maintainer['rfc822']
'James Troup <james@xxxxxxxxxx>'
The DSC signer IPerson:
- >>> ed_mixed_dsc.signer.displayname
+ >>> ed_source_dsc.signer.displayname
u'Foo Bar'
The IGPGKey used to sign this DSC, which will be stored as the
ISourcePackageRelease.dscsiginingkey:
- >>> ed_mixed_dsc.signingkey.displayname
+ >>> ed_source_dsc.signingkey.displayname
u'1024D/6C64A8C5'
The IGPGKey fingerprint used to sign this DSC:
- >>> print ed_mixed_dsc.fingerprint
+ >>> print ed_source_dsc.fingerprint
340CA3BB270E2716C9EE0B768E7EB7086C64A8C5
A DSCFile provides a verification API similiar to what we have in
ChangesFile itself:
- >>> errors = ed_mixed_dsc.verify()
+ >>> errors = ed_source_dsc.verify()
>>> errors
<generator ...>
>>> len(list(errors))
@@ -429,7 +436,7 @@
>>> ed_broken_dsc = DSCFile(
... datadir('ed_0.2-20.dsc'),
... 'e31eeb0b6b3b87e1ea79378df864ffff', 500, 'editors',
- ... 'important', 'ed', '0.2-20', ed_mixed_changes,
+ ... 'important', 'ed', '0.2-20', ed_source_changes,
... modified_insecure_policy, mock_logger_quiet)
>>> errors = ed_broken_dsc.verify()
@@ -441,7 +448,7 @@
>>> ed_broken_dsc = DSCFile(
... datadir('ed_0.2-20.dsc'),
... 'de8b206f8fc57bd931f6226feac6644a', 500, 'editors',
- ... 'important', 'ed', '0.2-20', ed_mixed_changes,
+ ... 'important', 'ed', '0.2-20', ed_source_changes,
... modified_insecure_policy, mock_logger_quiet)
>>> errors = ed_broken_dsc.verify()
@@ -453,12 +460,12 @@
Sub-DSCFiles are DSCUploadedFile objects.
- >>> ed_mixed_dsc.files[0]
+ >>> ed_source_dsc.files[0]
<lp.archiveuploader.dscfile.DSCUploadedFile ...>
We can also inspect the list of files declared in this DSC:
- >>> for dsc_file in ed_mixed_dsc.files:
+ >>> for dsc_file in ed_source_dsc.files:
... print dsc_file.filename
ed_0.2.orig.tar.gz
ed_0.2-20.diff.gz
@@ -490,7 +497,7 @@
>>> ed_binary_deb = DebBinaryUploadFile(ed_deb_path,
... 'e31eeb0b6b3b87e1ea79378df864ffff',
... 15, 'main/editors', 'important', 'foo', '1.2',
- ... ed_mixed_changes, modified_insecure_policy,
+ ... ed_binary_changes, modified_insecure_policy,
... mock_logger_quiet)
Like the other files it can be verified:
@@ -504,7 +511,7 @@
>>> ed_binary_deb = DebBinaryUploadFile(ed_deb_path,
... 'e31eeb0b6b3b87e1ea79378df864ffff',
... 15, 'main/net', 'important', 'foo', '1.2',
- ... ed_mixed_changes, modified_insecure_policy,
+ ... ed_binary_changes, modified_insecure_policy,
... mock_logger_quiet)
>>> list(ed_binary_deb.verify())
[UploadError('ed_0.2-20_i386.deb control file lists section as
@@ -515,7 +522,7 @@
>>> ed_binary_deb = DebBinaryUploadFile(ed_deb_path,
... 'e31eeb0b6b3b87e1ea79378df864ffff',
... 15, 'main/editors', 'extra', 'foo', '1.2',
- ... ed_mixed_changes, modified_insecure_policy,
+ ... ed_binary_changes, modified_insecure_policy,
... mock_logger_quiet)
>>> list(ed_binary_deb.verify())
[UploadError('ed_0.2-20_i386.deb control file lists priority as important
@@ -532,7 +539,7 @@
>>> ed_binary_deb = DebBinaryUploadFile(ed_deb_path,
... 'e31eeb0b6b3b87e1ea79378df864ffff',
... 15, 'main/editors', 'important', 'foo', '1.2',
- ... ed_mixed_changes, old_only_policy,
+ ... ed_binary_changes, old_only_policy,
... mock_logger_quiet)
>>> list(ed_binary_deb.verifyDebTimestamp())
[UploadError('ed_0.2-20_i386.deb: has 26 file(s) with a time stamp too
@@ -547,7 +554,7 @@
>>> ed_binary_deb = DebBinaryUploadFile(ed_deb_path,
... 'e31eeb0b6b3b87e1ea79378df864ffff',
... 15, 'main/editors', 'important', 'foo', '1.2',
- ... ed_mixed_changes, new_only_policy,
+ ... ed_binary_changes, new_only_policy,
... mock_logger_quiet)
>>> list(ed_binary_deb.verify())
[UploadError('ed_0.2-20_i386.deb: has 26 file(s) with a time stamp too
=== modified file 'lib/lp/archiveuploader/tests/test_nascentupload_documentation.py'
--- lib/lp/archiveuploader/tests/test_nascentupload_documentation.py 2010-08-04 00:16:44 +0000
+++ lib/lp/archiveuploader/tests/test_nascentupload_documentation.py 2010-08-20 13:31:08 +0000
@@ -42,7 +42,6 @@
"""Return a NascentUpload object for binaries."""
policy = getPolicy(name='sync', distro='ubuntu', distroseries='hoary')
policy.can_upload_binaries = True
- policy.can_upload_mixed = True
return NascentUpload.from_changesfile_path(
datadir(upload_path), policy, mock_logger_quiet)
=== modified file 'lib/lp/soyuz/browser/tests/distroseriesqueue-views.txt'
--- lib/lp/soyuz/browser/tests/distroseriesqueue-views.txt 2010-08-04 00:16:44 +0000
+++ lib/lp/soyuz/browser/tests/distroseriesqueue-views.txt 2010-08-20 13:31:08 +0000
@@ -247,6 +247,12 @@
Now that "foo" is published in Hoary, we can upload a new build.
+ # First we'll need to create a source publication for the foo-1.0-2,
+ # though, as our upload will only include binaries.
+ >>> foo_source_1_0_2 = stp.getPubSource(
+ ... sourcename="foo", distroseries=hoary, version="1.0-2",
+ ... status=PackagePublishingStatus.PUBLISHED)
+
>>> from canonical.launchpad.ftests import import_public_test_keys
>>> from canonical.launchpad.interfaces import IComponentSet
>>> from lp.soyuz.model.component import ComponentSelection
@@ -259,7 +265,6 @@
>>> sync_policy = getPolicy(name='sync', distro='ubuntu',
... distroseries='hoary')
>>> sync_policy.can_upload_binaries = True
- >>> sync_policy.can_upload_mixed = True
>>> foo_upload = NascentUpload.from_changesfile_path(
... datadir('suite/foo_1.0-2_multi_binary/foo_1.0-2_i386.changes'),
... sync_policy, mock_logger_quiet)
=== modified file 'lib/lp/soyuz/doc/distroseriesqueue.txt'
--- lib/lp/soyuz/doc/distroseriesqueue.txt 2010-08-04 00:16:44 +0000
+++ lib/lp/soyuz/doc/distroseriesqueue.txt 2010-08-20 13:31:08 +0000
@@ -65,12 +65,10 @@
Construct an upload.
>>> anything_policy = getPolicy(
- ... name='anything', distro='ubuntu', distroseries='hoary')
- >>> anything_policy.can_upload_binaries = True
- >>> anything_policy.can_upload_mixed = True
+ ... name='absolutely-anything', distro='ubuntu', distroseries='hoary')
>>> ed_upload = NascentUpload.from_changesfile_path(
- ... datadir('ed_0.2-20_i386.changes'),
+ ... datadir("ed_0.2-20_i386.changes.source-only-unsigned"),
... anything_policy, mock_logger_quiet)
>>> ed_upload.process()
@@ -110,8 +108,6 @@
... pub_records = item.realiseUpload(mock_logger)
ed
DEBUG: Publishing source ed/0.2-20 to ubuntu/hoary in the primary archive
- DEBUG: Publishing build to ubuntu/hoary/i386
- DEBUG: ... ed/0.2-20 (Arch Specific)
Confirm we can now find ed published in hoary.