l.a.d.DeathRow : class documentation

Part of lp.archivepublisher.deathrow View In Hierarchy

A Distribution Archive Removal Processor.

DeathRow will remove archive files from disk if they are marked for removal in the publisher tables, and if they are no longer referenced by other packages.

Method __init__ Undocumented
Method reap Reap packages that should be removed from the distribution.
Method canRemove Check if given (filename, MD5) can be removed from the pool.
Method _collectCondemned Return the condemned source and binary publications as a tuple.
Method _tryRemovingFromDisk Take the list of publishing records provided and unpublish them.
Method _markPublicationRemoved Undocumented
def __init__(self, archive, diskpool, logger):
Undocumented
def reap(self, dry_run=False):
Reap packages that should be removed from the distribution.

Looks through all packages that are in condemned states and have scheduleddeletiondate is in the past, try to remove their files from the archive pool (which may be impossible if they are used by other packages which are published), and mark them as removed.

def _collectCondemned(self):
Return the condemned source and binary publications as a tuple.

Return all the SourcePackagePublishingHistory and BinaryPackagePublishingHistory records that are eligible for removal ('condemned') where the source/binary package that they refer to is not published somewhere else.

Both sources and binaries are lists.

def canRemove(self, publication_class, filename, file_md5):
Check if given (filename, MD5) can be removed from the pool.

Check the archive reference-counter implemented in: SourcePackagePublishingHistory or BinaryPackagePublishingHistory.

Only allow removal of unnecessary files.

def _tryRemovingFromDisk(self, condemned_source_files, condemned_binary_files):
Take the list of publishing records provided and unpublish them.

You should only pass in entries you want to be unpublished because this will result in the files being removed if they're not otherwise in use.

def _markPublicationRemoved(self, condemned_records):
Undocumented
API Documentation for Launchpad, generated by pydoctor at 2019-05-22 00:00:12.