Part of lp.archivepublisher.domination View In Hierarchy
Packages are marked as superseded when they become obsolete.
Method | __init__ | Initialize the dominator. |
Method | dominatePackage | Dominate publications for a single package. |
Method | findBinariesForDomination | Find binary publications that need dominating. |
Method | dominateBinaries | Perform domination on binary package publications. |
Method | findSourcesForDomination | Find binary publications that need dominating. |
Method | dominateSources | Perform domination on source package publications. |
Method | findPublishedSourcePackageNames | Find currently published source packages. |
Method | findPublishedSPPHs | Find currently published source publications for given package. |
Method | dominateSourceVersions | Dominate source publications based on a set of "live" versions. |
Method | judge | Judge superseded sources and binaries. |
Method | judgeAndDominate | Perform the domination and superseding calculations |
Method | _sortPackages | Partition publications by package name, and sort them. |
Method | _setScheduledDeletionDate | Set the scheduleddeletiondate on a publishing record. |
Method | _judgeSuperseded | Determine whether the superseded packages supplied should |
Method | _composeActiveSourcePubsCondition | Compose ORM condition for restricting relevant source pubs. |
This process should be run after the publisher has published new stuff into the distribution but before the publisher creates the file lists for apt-ftparchive.
The latest publication for any version in live_versions
stays
active. Any older publications (including older publications for
live versions with multiple publications) are marked as superseded by
the respective oldest live releases that are newer than the superseded
ones.
Any versions that are newer than anything in live_versions
are
marked as deleted. This should not be possible in Soyuz-native
archives, but it can happen during archive imports when the
previous latest version of a package has disappeared from the Sources
list we import.
Parameters | sorted_pubs | A list of publications for the same package,
in the same archive, series, and pocket, all with status
PackagePublishingStatus.PUBLISHED . They must be sorted from
most current to least current, as would be the result of
generalization.sortPublications . |
live_versions | Iterable of versions that are still considered
"live" for this package. For any of these, the latest publication
among publications will remain Published. Publications for
older releases, as well as older publications of live versions,
will be marked as Superseded. Publications of newer versions than
are listed in live_versions are marked as Deleted. | |
generalization | A GeneralizedPublication helper representing
the kind of publications these are: source or binary. |
The publications are sorted from most current to least current,
as required by dominatePackage
etc.
Parameters | publications | An iterable of SourcePackagePublishingHistory
or of BinaryPackagePublishingHistory . |
generalization | A GeneralizedPublication helper representing
the kind of publications these are: source or binary. | |
Returns | A dict mapping each package name to a sorted list of
publications from publications . |
If the status is DELETED we set the date to UTC_NOW, otherwise it gets the configured stay of execution period.
Currently this is done by assuming that any superseded binary package should be removed. In the future this should attempt to supersede binaries in build-sized chunks only, bug 55030.
Superseded source packages are considered removable when they have no binaries in this distroseries which are published or superseded
When a package is considered for death row it is given a 'scheduled deletion date' of now plus the defined 'stay of execution' time provided in the configuration parameter.
This is only for traditional domination, where the latest published publication is always kept published. It will ignore publications that have no other publications competing for the same binary package.
Dominates binaries, restricted to distroseries
, pocket
, and
self.archive
.
This is only for traditional domination, where the latest published
publication is always kept published. See find_live_source_versions
for this logic.
To optimize for that logic, findSourcesForDomination
will ignore
publications that have no other publications competing for the same
binary package. There'd be nothing to do for those cases.
Dominates sources, restricted to distroseries
, pocket
, and
self.archive
.
Returns an iterable of tuples: (name of source package, number of publications in Published state).
Active publications for the "live" versions will remain active. All other active publications for the same package (and the same archive, distroseries, and pocket) are marked superseded.
Unlike traditional domination, this allows multiple versions of a package to stay active in the same distroseries, archive, and pocket.
Parameters | distroseries | DistroSeries to dominate. |
PackagePublishingPocket to dominate. | ||
package_name | Source package name, as text. | |
live_versions | Iterable of all version strings that are to remain active. |