l.a.d.DSCFile(SourceUploadFile, SignableTagFile) : class documentation

Part of lp.archiveuploader.dscfile View In Hierarchy

Models a given DSC file and its content.
Method __init__ Construct a DSCFile instance.
Method source Return the DSC source name.
Method dsc_version Return the DSC source version.
Method format Return the DSC format.
Method architecture Return the DSC source architecture.
Method binary Return the DSC claimed binary line.
Method verify Verify the uploaded .dsc file.
Method checkFiles Check if mentioned files are present and match.
Method unpackAndCheckSource Verify uploaded source using dpkg-source.
Method storeInDatabase Store DSC information as a SourcePackageRelease record.
Method _getFileByName Return the corresponding file reference in the policy context.

Inherited from SourceUploadFile:

Method filetype Undocumented
Method checkBuild See PackageUploadFile.

Inherited from SourceFileMixin (via SourceUploadFile):

Method is_orig Undocumented

Inherited from PackageUploadFile (via SourceUploadFile):

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 SourceUploadFile, 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.

Inherited from SignableTagFile:

Method signer Undocumented
Method parse Parse the tag file, optionally verifying the signature.
Method parseAddress Parse an address, using the policy to decide if we should add a
Method _verifySignature Verify the signature on the file content.
def __init__(self, filepath, checksums, size, component_and_section, priority, package, version, changes, policy, logger):
Construct a DSCFile instance.

This takes all NascentUploadFile constructor parameters plus package and version.

Can raise UploadError.

@property
def source(self):
Return the DSC source name.
@property
def dsc_version(self):
Return the DSC source version.
@property
def format(self):
Return the DSC format.
@property
def architecture(self):
Return the DSC source architecture.
@property
def binary(self):
Return the DSC claimed binary line.
def verify(self):
Verify the uploaded .dsc file.

This method is an error generator, i.e, it returns an iterator over all exceptions that are generated while processing DSC file checks.

def _getFileByName(self, filename):
Return the corresponding file reference in the policy context.

If the filename ends in '.orig.tar.gz', then we look for it in the distribution primary archive as well, with the PPA file taking precedence in case it's found in both archives.

This is needed so that PPA uploaders don't have to waste bandwidth uploading huge upstream tarballs that are already published in the target distribution.

When the file reference is found, its corresponding LibraryFileAlias and Archive are returned.

Parametersfilenamestring containing the exact name of the wanted file.
Returnsa tuple containing a ILibraryFileAlias corresponding to the matching file and an Archive where it was published.
RaisesNotFoundError when the wanted file could not be found.
def checkFiles(self):
Check if mentioned files are present and match.

We don't use the NascentUploadFile.verify here, only verify size and checksum.

def unpackAndCheckSource(self):
Verify uploaded source using dpkg-source.
def storeInDatabase(self, build):
Store DSC information as a SourcePackageRelease record.

It reencodes all fields extracted from DSC, the simulated_changelog and the copyright, because old packages contain latin-1 text and that sucks.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.