l.s.s.f.ArchiveCruftChecker : class documentation

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

Perform overall checks to identify and remove obsolete records.

Use initialize() method to validate passed parameters and build the infrastructure variables. It will raise ArchiveCruftCheckerError if something goes wrong.

Method __init__ Store passed arguments.
Method architectures Undocumented
Method components Undocumented
Method components_and_di Undocumented
Method dist_archive Undocumented
Method gunzipTagFileContent Gunzip the contents of passed filename.
Method processSources Process archive sources index.
Method buildNBS Build the group of 'not build from source' binaries
Method buildArchNBS Build NBS per architecture.
Method buildASBA Build the group of 'all superseded by any' binaries.
Method buildArchASBA Build ASBA per architecture.
Method addNBS Add a new entry in given organized nbs_d list
Method refineNBS Distinguish dubious from real NBS.
Method outputNBS Properly display built NBS entries.
Method initialize Initialise and build required lists of obsolete entries in archive.
Method doRemovals Perform the removal of the obsolete packages found.
def __init__(self, logger, distribution_name='ubuntu', suite=None, archive_path='/srv/launchpad.net/ubuntu-archive'):
Store passed arguments.

Also Initialize empty variables for storing preliminar results.

@property
def architectures(self):
Undocumented
@property
def components(self):
Undocumented
@property
def components_and_di(self):
Undocumented
@property
def dist_archive(self):
Undocumented
def gunzipTagFileContent(self, filename):

Gunzip the contents of passed filename.

Check filename presence, if not present in the filesystem, raises ArchiveCruftCheckerError. Use an tempfile.mkstemp() to store the uncompressed content. Invoke system available gunzip`, raises ArchiveCruftCheckError if it fails.

This method doesn't close the file descriptor used and does not remove the temporary file from the filesystem, those actions are required in the callsite. (apt_pkg.ParseTagFile is lazy)

Return a tuple containing:
  • temp file descriptor
  • temp filename
  • the contents parsed by apt_pkg.ParseTagFile()
def processSources(self):
Process archive sources index.

Build source_binaries, source_versions and bin_pkgs lists.

def buildNBS(self):
Build the group of 'not build from source' binaries
def buildArchNBS(self, component, architecture):
Build NBS per architecture.

Store results in self.nbs, also build architecture specific binaries group (stored in self.arch_any)

def buildASBA(self):
Build the group of 'all superseded by any' binaries.
def buildArchASBA(self, component, architecture):
Build ASBA per architecture.

Store the result in self.asba, require self.arch_any to be built previously.

def addNBS(self, nbs_d, source, version, package):
Add a new entry in given organized nbs_d list

Ensure the package is still published in the suite before add.

def refineNBS(self):
Distinguish dubious from real NBS.

They are 'dubious' if the version numbers match and 'real' if the versions don't match. It stores results in self.dubious_nbs and self.real_nbs.

def outputNBS(self):
Properly display built NBS entries.

Also organize the 'real' NBSs for removal in self.nbs_to_remove attribute.

def initialize(self):
Initialise and build required lists of obsolete entries in archive.

Check integrity of passed parameters and store organised data. The result list is the self.nbs_to_remove which should contain obsolete packages not currently able to be built from again. Another preliminary lists can be inspected in order to have better idea of what was computed. If anything goes wrong mid-process, it raises ArchiveCruftCheckError, otherwise a list of packages to be removes is printed.

def doRemovals(self):
Perform the removal of the obsolete packages found.

It iterates over the previously build list (self.nbs_to_remove) and mark them as 'superseded' in the archive DB model. They will get removed later by the archive sanity check run each cycle of the cron.daily.

API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.