l.a.m.f.FTPArchiveHandler : class documentation

Part of lp.archivepublisher.model.ftparchive View In Hierarchy

Produces Sources and Packages files via apt-ftparchive.

Generates file lists and configuration for apt-ftparchive, and kicks off generation of the Sources and Releases files.

Method __init__ Undocumented
Method run Do the entire generation and run process.
Method runAptWithArgs Run apt-ftparchive in subprocesses.
Method runApt Undocumented
Method createEmptyPocketRequests Write out empty file lists etc for pockets.
Method createEmptyPocketRequest Creates empty files for a release pocket and distroseries
Method getSourcesForOverrides Fetch override information about all published sources.
Method getBinariesForOverrides Fetch override information about all published binaries.
Method generateOverrides Collect packages that need overrides, and generate them.
Method publishOverrides Output a set of override files for use in apt-ftparchive.
Method generateOverrideForComponent Generates overrides for a specific component.
Method getSourceFiles Fetch publishing information about all published source files.
Method getBinaryFiles Fetch publishing information about all published binary files.
Method generateFileLists Collect currently published FilePublishings and write filelists.
Method publishFileLists Collate the set of source files and binary files provided and
Method writeFileList Output file lists for a series and architecture.
Method generateConfig Generate an APT FTPArchive configuration from the provided
Method generateConfigForPocket Generates the config stanza for an individual pocket.
Method writeAptConfig Undocumented
Method cleanCaches Clean apt-ftparchive caches.
def __init__(self, log, config, diskpool, distro, publisher):
Undocumented
def run(self, is_careful):
Do the entire generation and run process.
def runAptWithArgs(self, apt_config_filename, *args):
Run apt-ftparchive in subprocesses.
RaisesAptFTPArchiveFailure if any of the apt-ftparchive commands failed.
def runApt(self, apt_config_filename):
Undocumented
def createEmptyPocketRequests(self, fullpublish=False):
Write out empty file lists etc for pockets.

We do this to have Packages or Sources for them even if we lack anything in them currently.

def createEmptyPocketRequest(self, distroseries, pocket, comp):
Creates empty files for a release pocket and distroseries
def getSourcesForOverrides(self, distroseries, pocket):
Fetch override information about all published sources.

The override information consists of tuples with 'sourcename', 'component' and 'section' strings, in this order.

Parametersdistroseriestarget IDistroSeries
pockettarget PackagePublishingPocket
Returnsa ResultSet with the source override information tuples
def getBinariesForOverrides(self, distroseries, pocket):
Fetch override information about all published binaries.

The override information consists of tuples with 'binaryname', 'component', 'section', 'architecture' and 'priority' strings, 'binpackageformat' enum, 'phased_update_percentage' integer, in this order.

Parametersdistroseriestarget IDistroSeries
pockettarget PackagePublishingPocket
Returnsa ResultSet with the binary override information tuples
def generateOverrides(self, fullpublish=False):
Collect packages that need overrides, and generate them.
def publishOverrides(self, suite, source_publications, binary_publications):
Output a set of override files for use in apt-ftparchive.

Given the provided sourceoverrides and binaryoverrides, do the override file generation. The files will be written to overrideroot with filenames of the form:

override.<distroseries>.<component>[.src]
Attributes which must be present in sourceoverrides are:
drname, spname, cname, sname
Attributes which must be present in binaryoverrides are:
drname, spname, cname, sname, archtag, priority, phased_update_percentage

The binary priority will be mapped via the values in dbschema.py.

def generateOverrideForComponent(self, overrides, suite, component):
Generates overrides for a specific component.
def getSourceFiles(self, distroseries, pocket):
Fetch publishing information about all published source files.

The publishing information consists of tuples with 'sourcename', 'filename' and 'component' strings, in this order.

Parametersdistroseriestarget IDistroSeries
pockettarget PackagePublishingPocket
Returnsa ResultSet with the source files information tuples.
def getBinaryFiles(self, distroseries, pocket):
Fetch publishing information about all published binary files.

The publishing information consists of tuples with 'sourcename', 'filename', 'component' and 'architecture' strings, in this order.

Parametersdistroseriestarget IDistroSeries
pockettarget PackagePublishingPocket
Returnsa ResultSet with the binary files information tuples.
def generateFileLists(self, fullpublish=False):
Collect currently published FilePublishings and write filelists.
def publishFileLists(self, suite, sourcefiles, binaryfiles):
Collate the set of source files and binary files provided and write out all the file list files for them.

listroot/distroseries_component_source listroot/distroseries_component_binary-archname

def writeFileList(self, arch, file_names, dr_pocketed, component):
Output file lists for a series and architecture.

This includes the subcomponent file lists.

def generateConfig(self, fullpublish=False):
Generate an APT FTPArchive configuration from the provided config object and the paths we either know or have given to us.

If fullpublish is true, we generate config for everything.

Otherwise, we aim to limit our config to certain distroseries and pockets. By default, we will exclude release pockets for released series, and in addition we exclude any pocket not explicitly marked as dirty. dirty_pockets must be a nested dictionary of booleans, keyed by distroseries.name then pocket.

def generateConfigForPocket(self, apt_config, distroseries, pocket):
Generates the config stanza for an individual pocket.
def writeAptConfig(self, apt_config, suite, comps, archs, include_long_descriptions, index_compressors):
Undocumented
def cleanCaches(self):
Clean apt-ftparchive caches.

This takes a few minutes and doesn't need to be done on every run, but it should be done every so often so that the cache files don't get too large and slow down normal runs of apt-ftparchive.

API Documentation for Launchpad, generated by pydoctor at 2019-08-20 00:00:04.