Part of lp.archivepublisher
Archive Domination class.
We call 'domination' the procedure used to identify and supersede all old versions for a given publication, source or binary, inside a suite (distroseries + pocket, for instance, gutsy or gutsy-updates).
It also processes the superseded publications and makes the ones with unnecessary files 'eligible for removal', which will then be considered for archive removal. See deathrow.py.
In order to judge if a source is 'eligible for removal' it also checks if its resulting binaries are not necessary any more in the archive, i.e., old binary publications can (and should) hold sources in the archive.
Source version life-cycle example:
- foo_2.1: currently published, source and binary files live in the archive
pool and it is listed in the archive indexes.
- foo_2.0: superseded, it's not listed in archive indexes but one of its
files is used for foo_2.1 (the orig.tar.gz) or foo_2.1 could not build for one or more architectures that foo_2.0 could;
- foo_1.8: eligible for removal, none of its files are required in the
archive since foo_2.0 was published (new orig.tar.gz) and none of its binaries are published (foo_2.0 was completely built)
- foo_1.0: removed, it already passed through the quarantine period and its
files got removed from the archive.
Note that:
- PUBLISHED and SUPERSEDED are publishing statuses.
- 'eligible for removal' is a combination of SUPERSEDED or DELETED publishing status and a defined (non-empty) 'scheduleddeletiondate'.
- 'removed' is a combination of 'eligible for removal' and a defined (non-empy) 'dateremoved'.
The 'domination' procedure is the 2nd step of the publication pipeline and it is performed for each suite using:
- judgeAndDominate(distroseries, pocket)
Function | join_spph_spn | Join condition: SourcePackagePublishingHistory/SourcePackageName. |
Function | join_spph_spr | Join condition: SourcePackageRelease/SourcePackagePublishingHistory. |
Class | SourcePublicationTraits | Basic generalized attributes for SourcePackagePublishingHistory . |
Class | BinaryPublicationTraits | Basic generalized attributes for BinaryPackagePublishingHistory . |
Class | GeneralizedPublication | Generalize handling of publication records. |
Function | find_live_source_versions | Find versions out of Published publications that should stay live. |
Function | get_binary_versions | List versions for sequence of BinaryPackagePublishingHistory . |
Function | find_live_binary_versions_pass_1 | Find versions out of Published publications that should stay live. |
Class | ArchSpecificPublicationsCache | Cache to track which releases have arch-specific publications. |
Function | find_live_binary_versions_pass_2 | Find versions out of Published publications that should stay live. |
Function | contains_arch_indep | Are any of the publications among bpphs architecture-independent? |
Class | Dominator | Manage the process of marking packages as superseded. |
This particular notion of liveness applies to source domination: the latest version stays live, and that's it.
Parameters | sorted_pubs | An iterable of SourcePackagePublishingHistory
sorted by descending package version. |
Returns | A list of live versions. |
BinaryPackagePublishingHistory
.Parameters | binary_publications | An iterable of
BinaryPackagePublishingHistory . |
Returns | A list of the publications' respective versions. |
publications
that should stay live.
This particular notion of liveness applies to first-pass binary domination: the latest version stays live, and so do publications of binary packages for the "all" architecture.
Parameters | sorted_pubs | An iterable of BinaryPackagePublishingHistory ,
sorted by descending package version. |
Returns | A list of live versions. |
This particular notion of liveness applies to second-pass binary domination: the latest version stays live, and architecture-specific publications stay live (i.e, ones that are not for the "all" architecture).
More importantly, any publication for binary packages of the "all" architecture stay live if any of the non-"all" binary packages from the same source package release are still active -- even if they are for other architectures.
This is the raison d'etre for the two-pass binary domination algorithm: to let us see which architecture-independent binary publications can be superseded without rendering any architecture-specific binaries from the same source package release uninstallable.
(Note that here, "active" includes Published publications but also Pending ones. This is standard nomenclature in Soyuz. Some of the domination code confuses matters by using the term "active" to mean only Published publications).
Parameters | sorted_pubs | An iterable of BinaryPackagePublishingHistory ,
sorted by descending package version. |
cache | An ArchSpecificPublicationsCache to reduce the number of
times we need to look up whether an spr/archive/distroseries/pocket
has active arch-specific publications. | |
Returns | A list of live versions. |