l.s.s.packagecopier : module documentation

Part of lp.soyuz.scripts

Package copying utilities.
Function update_files_privacy Update file privacy according to the publishing destination
Function has_restricted_files Whether or not a given source files has restricted files.
Class CheckedCopy Representation of a copy that was checked and approved.
Function check_copy_permissions Check that person has permission to copy a package.
Class CopyChecker Check copy candiates.
Function do_copy Perform the complete copy of the given sources incrementally.
Function _do_direct_copy Copy publishing records to another location.
def update_files_privacy(pub_record):
Update file privacy according to the publishing destination
Parameterspub_recordOne of a SourcePackagePublishingHistory or BinaryPackagePublishingHistory record.
Returnsa list of changed LibraryFileAlias objects.
def has_restricted_files(source):
Whether or not a given source files has restricted files.
def check_copy_permissions(person, archive, series, pocket, sources):
Check that `person` has permission to copy a package.

:param person: User attempting the upload.
:param archive: Destination `Archive`.
:param series: Destination `DistroSeries`.
:param pocket: Destination `Pocket`.
:param sources: Sequence of `SourcePackagePublishingHistory`s for the
    packages to be copied.
:raises CannotCopy: If the copy is not allowed.
def do_copy(sources, archive, series, pocket, include_binaries=False, person=None, check_permissions=True, overrides=None, send_email=False, strict_binaries=True, close_bugs=True, create_dsd_job=True, announce_from_person=None, sponsored=None, packageupload=None, unembargo=False, phased_update_percentage=None, logger=None):

Perform the complete copy of the given sources incrementally.

Verifies if each copy can be performed using CopyChecker and raises CannotCopy if one or more copies could not be performed.

When CannotCopy is raised, call sites are responsible for rolling back the transaction. Otherwise, performed copies will be commited.

Wrapper for do_direct_copy.

:raise CannotCopy when one or more copies were not allowed. The error
will contain the reason why each copy was denied.
Parameterssourcesa list of ISourcePackagePublishingHistory.
archivethe target IArchive.
seriesthe target IDistroSeries, if None is given the same current source distroseries will be used as destination.
pocketthe target PackagePublishingPocket.
include_binariesoptional boolean, controls whether or not the published binaries for each given source should be also copied along with the source.
personthe requester IPerson.
check_permissionsboolean indicating whether or not the requester's permissions to copy should be checked.
overridesA list of IOverride as returned from one of the copy policies which will be used as a manual override insyead of using the default override returned by IArchive.getOverridePolicy(). There must be the same number of overrides as there are sources and each override must be for the corresponding source in the sources list.
send_emailShould we notify for the copy performed? NOTE: If running in zopeless mode, the email is sent even if the transaction is later aborted. (See bug 29744)
announce_from_personIf send_email is True, then send announcement emails with this person as the From:
strict_binariesIf 'include_binaries' is True then setting this to True will make the copy fail if binaries cannot be also copied.
close_bugsA boolean indicating whether or not bugs on the copied publications should be closed.
create_dsd_jobA boolean indicating whether or not a dsd job should be created for the new source publication.
sponsoredAn IPerson representing the person who is being sponsored for this copy. May be None, but if present will affect the "From:" address on notifications and the creator of the publishing record will be set to this person.
packageuploadThe IPackageUpload that caused this publication to be created.
unembargoIf True, allow copying restricted files from a private archive to a public archive, and unrestrict their library files when doing so.
phased_update_percentageThe phased update percentage to apply to the copied publication.
loggerAn optional logger.
Returnsa list of ISourcePackagePublishingHistory and BinaryPackagePublishingHistory corresponding to the copied publications.
def _do_direct_copy(source, archive, series, pocket, include_binaries, override=None, close_bugs=True, create_dsd_job=True, close_bugs_since_version=None, creator=None, sponsor=None, packageupload=None, phased_update_percentage=None, logger=None):
Copy publishing records to another location.

Copy each item of the given list of SourcePackagePublishingHistory to the given destination if they are not yet available (previously copied).

Also copy published binaries for each source if requested to. Again, only copy binaries that were not yet copied before.

Parameterssourcean ISourcePackagePublishingHistory.
archivethe target IArchive.
seriesthe target IDistroSeries, if None is given the same current source distroseries will be used as destination.
pocketthe target PackagePublishingPocket.
include_binariesoptional boolean, controls whether or not the published binaries for each given source should be also copied along with the source.
overrideAn IOverride as per do_copy().
close_bugsA boolean indicating whether or not bugs on the copied publication should be closed.
create_dsd_jobA boolean indicating whether or not a dsd job should be created for the new source publication.
close_bugs_since_versionIf close_bugs is True, then this parameter says which changelog entries to parse looking for bugs to close. See close_bugs_for_sourcepackagerelease.
creatorthe requester IPerson.
sponsorthe sponsor IPerson, if this copy is being sponsored.
packageuploadThe IPackageUpload that caused this publication to be created.
phased_update_percentageThe phased update percentage to apply to the copied publication.
loggerAn optional logger.
Returnsa list of ISourcePackagePublishingHistory and BinaryPackagePublishingHistory corresponding to the copied publications.
API Documentation for Launchpad, generated by pydoctor at 2018-05-22 00:00:04.