l.s.s.p.CopyChecker : class documentation

Part of lp.soyuz.scripts.packagecopier View In Hierarchy

Check copy candiates.

Allows the checker function to identify conflicting copy candidates within the copying batch.

Method __init__ Initialize a copy checker.
Method addCopy Store a copy in the inventory as a CheckedCopy instance.
Method getCheckedCopies Return a list of copies allowed to be performed.
Method getConflicts Conflicting CheckedCopy objects in the inventory.
Method checkCopy Check if the source can be copied to the given location.
Method _getInventoryKey Return a key representing the copy candidate in the inventory.
Method _checkArchiveConflicts Check for possible conflicts in the destination archive.
Method _checkConflictingFiles Undocumented
def __init__(self, archive, include_binaries, strict_binaries=True, unembargo=False):
Initialize a copy checker.
Parametersarchivethe target IArchive.
include_binariescontrols whether or not the published binaries for each given source should be also copied along with the source.
strict_binariesIf 'include_binaries' is True then setting this to True will make the copy fail if binaries cannot be also copied.
unembargoIf True, allow copying from a private archive to a public archive.
def _getInventoryKey(self, candidate):
Return a key representing the copy candidate in the inventory.
Parameterscandidatea ISourcePackagePublishingHistory copy candidate.
Returnsa tuple with the source (name, version) strings.
def addCopy(self, source):
Store a copy in the inventory as a CheckedCopy instance.
def getCheckedCopies(self):
Return a list of copies allowed to be performed.
def getConflicts(self, candidate):
Conflicting CheckedCopy objects in the inventory.
Parameterscandidatea ISourcePackagePublishingHistory copy candidate.
Returnsa list of conflicting copies in the inventory, in case of non-conflicting candidates an empty list is returned.
def _checkArchiveConflicts(self, source, series):
Check for possible conflicts in the destination archive.

Check if there is a source with the same name and version published in the destination archive or in the inventory of copies already approved. If it exists (regardless of the series and pocket) and it has built or will build binaries, do not allow the copy without binaries.

This is because the copied source will rebuild binaries that conflict with existing ones.

Even when the binaries are included, they are checked for conflict.

Parameterssourcecopy candidate, ISourcePackagePublishingHistory.
seriesdestination IDistroSeries.
RaisesCannotCopywhen a copy is not allowed to be performed containing the reason of the error.
def _checkConflictingFiles(self, source):
Undocumented
def checkCopy(self, source, series, pocket, person=None, check_permissions=True):

Check if the source can be copied to the given location.

Check possible conflicting publications in the destination archive. See _checkArchiveConflicts().

Also checks if the version of the source being copied is equal or higher than any version of the same source present in the destination suite (series + pocket).

If person is not None, check that this person has upload rights to the destination (archive, component, pocket).

:raise CannotCopy when a copy is not allowed to be performed
containing the reason of the error.
Parameterssourcecopy candidate, ISourcePackagePublishingHistory.
seriesdestination IDistroSeries.
pocketdestination PackagePublishingPocket.
personrequester IPerson.
check_permissionsboolean indicating whether or not the requester's permissions to copy should be checked.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.