l.a.n.BaseBinaryUploadFile(PackageUploadFile) : class documentation

Part of lp.archiveuploader.nascentuploadfile View In Hierarchy

Known subclasses: lp.archiveuploader.nascentuploadfile.DebBinaryUploadFile, lp.archiveuploader.nascentuploadfile.UdebBinaryUploadFile

Base methods for binary upload modeling.
Method __init__ Check presence of the component and section from an uploaded_file.
Method is_archindep Check if the binary is targeted to architecture 'all'.
Method archtag Return the binary target architecture.
Method priority Checks whether the priority indicated is valid
Method local_checks Should be implemented locally.
Method verify Verify the contents of the .deb or .udeb as best we can.
Method extractAndParseControl Extract and parse control information.
Method parseControl Undocumented
Method verifyPackage Check if the binary is in changesfile and its name is valid.
Method verifyVersion Check if control version is valid matches the filename version.
Method verifyArchitecture Check if the control architecture matches the changesfile.
Method verifyDepends Check if control depends field is present and not empty.
Method verifySection Check the section & priority match those in changesfile.
Method verifyPriority Check if priority matches changesfile.
Method verifyFormat Check if the DEB format is sane.
Method verifyDebTimestamp Check specific DEB format timestamp checks.
Method findCurrentSourcePublication Return the respective ISourcePackagePublishingHistory for this
Method findSourcePackageRelease Return the respective ISourcePackageRelease for this binary upload.
Method verifySourcePackageRelease Check if the given ISourcePackageRelease matches the context.
Method findBuild Find and return a build for the given archtag, cached on policy.
Method checkBuild See PackageUploadFile.
Method storeInDatabase Insert this binary release and build into the database.

Inherited from PackageUploadFile:

Method component Return an IComponent for self.component.name.
Method section Return an ISection for self.section_name.
Method extractUserDefinedFields Extract the user defined fields out of a control file list.

Inherited from NascentUploadFile (via PackageUploadFile):

Method content_type The content type for this file.
Method filename Return the NascentUpload filename.
Method dirname Return the NascentUpload filename.
Method exists_on_disk Whether or not the file is present on disk.
Method checkNameIsTaintFree Verify if the filename contains forbidden characters.
Method checkSizeAndCheckSum Check the size and checksums of the nascent file.
def __init__(self, filepath, md5, size, component_and_section, priority_name, package, version, changes, policy, logger):
Check presence of the component and section from an uploaded_file.

They need to satisfy at least the NEW queue constraints that includes SourcePackageRelease creation, so component and section need to exist. Even if they might be overridden in the future.

@property
def is_archindep(self):
Check if the binary is targeted to architecture 'all'.

We call binaries in this condition 'architecture-independent', i.e. They can be build in any architecture and the result will fit all architectures available.

@property
def archtag(self):
Return the binary target architecture.

If the binary is architecture independent, return the architecture of the machine that has built it (it is encoded in the changesfile name).

@property
def priority(self):
Checks whether the priority indicated is valid
@property
def local_checks(self):
Should be implemented locally.
def verify(self):
Verify the contents of the .deb or .udeb as best we can.

It returns an iterator over all the encountered errors and warnings.

def extractAndParseControl(self):
Extract and parse control information.
def parseControl(self, control):
Undocumented
def verifyPackage(self):
Check if the binary is in changesfile and its name is valid.
def verifyVersion(self):
Check if control version is valid matches the filename version.

Binary version doesn't need to match the changesfile version, because the changesfile version refers to the SOURCE version.

def verifyArchitecture(self):
Check if the control architecture matches the changesfile.

Also check if it is a valid architecture in LP context.

def verifyDepends(self):
Check if control depends field is present and not empty.
def verifySection(self):
Check the section & priority match those in changesfile.
def verifyPriority(self):
Check if priority matches changesfile.
def verifyFormat(self):
Check if the DEB format is sane.

We run 'dpkg-deb' to look at the contents of the deb files to confirm they make sense.

def verifyDebTimestamp(self):
Check specific DEB format timestamp checks.
def findCurrentSourcePublication(self):
Return the respective ISourcePackagePublishingHistory for this binary upload.

It inspects publication in the targeted DistroSeries.

It raises UploadError if the spph was not found.

def findSourcePackageRelease(self):
Return the respective ISourcePackageRelease for this binary upload.

It inspect publication in the targeted DistroSeries.

It raises UploadError if the source was not found.

Verifications on the designed source are delayed because for mixed_uploads (source + binary) we do not have the source stored in DB yet (see verifySourcepackagerelease).

def verifySourcePackageRelease(self, sourcepackagerelease):
Check if the given ISourcePackageRelease matches the context.
def findBuild(self, sourcepackagerelease):
Find and return a build for the given archtag, cached on policy.

To find the right build, we try these steps, in order, until we have one: - Check first if a build id was provided. If it was, load that build. - Try to locate an existing suitable build, and use that. We also, in this case, change this build to be FULLYBUILT. - Create a new build in FULLYBUILT status.

def checkBuild(self, build):
See PackageUploadFile.
def storeInDatabase(self, build):
Insert this binary release and build into the database.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.