l.s.s.i.InitializeDistroSeries : class documentation

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

Copy in all of the parents distroseries's configuration. This includes all configuration for distroseries as well as distroarchseries, publishing and all publishing records for sources and binaries.

We support 2 use cases here:
#1 If the child distribution has zero initialized series:
  • the parent list can't be empty (otherwise we trigger an error);
  • the series will be derived from the parents passed as argument;
  • the parents will be set to the parents passed as argument;
  • first_derivation = True.
#2 If the child distribution has more than zero initialized series:
  • the series will be derived from the previous_series;
  • the parents will be set to the parents passed as argument or the parents of the previous_series if the passed argument is empty;
  • first_derivation = False.
Preconditions:
The distroseries must exist, and be completly unused, with no source or binary packages existing, as well as no distroarchseries set up. Section and component selections must be empty. It must not have any parent series.
Outcome:
The distroarchseries set up in the parent series will be copied. The publishing structure will be copied from the parents. All PUBLISHED and PENDING packages in the parents will be created in this distroseries and its distroarchseriess. All component and section selections will be duplicated, as will any permission-related structures.
Note:
This method will raise a InitializationError when the pre-conditions are not met. After this is run, you still need to construct chroots for building, you need to add anything missing wrt. ports etc. This method is only meant to give you a basic copy of parent series in order to assist you in preparing a new series of a distribution or in the initialization of a derivative.
Method __init__ Undocumented
Method check Undocumented
Method initialize Undocumented
Method _checkArchindep Undocumented
Method _checkPublisherConfig A series cannot be initialized if it has no publisher config
Method _checkParents If self.first_derivation, the parents list cannot be empty.
Method _checkBuilds Assert there are no pending builds for the given parent series.
Method _checkQueue Assert upload queue is empty on the given parent series.
Method _checkSeries Undocumented
Method _set_parents Undocumented
Method _set_initialized Undocumented
Method _has_same_parents_as_previous_series Undocumented
Method _create_dsds Undocumented
Method _copy_dsds_from_previous_series Undocumented
Method _create_dsd_jobs Undocumented
Method _copy_configuration Undocumented
Method _copy_architectures Undocumented
Method _set_nominatedarchindep Undocumented
Method _potential_nominated_arches Undocumented
Method _copy_packages Undocumented
Method _use_cloner Returns True if it's safe to use the packagecloner (as opposed
Method _create_source_names_by_parent If only a subset of the packagesets was selected to be copied,
Method _copy_publishing_records Copy the publishing records from the parent arch series
Method _rescore_rebuilds Rescore the passed builds so that they have an appropriately low
Method _copy_component_section_and_format_selections Copy the section, component and format selections from the parents
Method _copy_packaging_links Copy the packaging links from the parent series to this one.
Method _copy_packagesets Copy packagesets from the parent distroseries.
Method _copy_pocket_permissions Copy per-distroseries/pocket permissions from the parent series.
def __init__(self, distroseries, parents=(), arches=(), archindep_archtag=None, packagesets=None, rebuild=False, overlays=(), overlay_pockets=(), overlay_components=()):
Undocumented
def check(self):
Undocumented
def _checkArchindep(self):
Undocumented
def _checkPublisherConfig(self):
A series cannot be initialized if it has no publisher config set up.
def _checkParents(self):
If self.first_derivation, the parents list cannot be empty.
def _checkBuilds(self, parent):
Assert there are no pending builds for the given parent series.

Only cares about the RELEASE, SECURITY, UPDATES and PROPOSED pockets, which are the only ones inherited via the initializeFromParent method. Restrict the check to the select architectures (if applicable). Restrict the check to the selected packages if a limited set of packagesets is used by the initialization.

def _checkQueue(self, parent):
Assert upload queue is empty on the given parent series.

Only cares about the RELEASE, SECURITY, UPDATES and PROPOSED pockets, which are the only ones inherited via the initializeFromParent method. Restrict the check to the selected packages if a limited set of packagesets is used by the initialization.

def _checkSeries(self):
Undocumented
def initialize(self):
Undocumented
def _set_parents(self):
Undocumented
def _set_initialized(self):
Undocumented
def _has_same_parents_as_previous_series(self):
Undocumented
def _create_dsds(self):
Undocumented
def _copy_dsds_from_previous_series(self):
Undocumented
def _create_dsd_jobs(self):
Undocumented
def _copy_configuration(self):
Undocumented
def _copy_architectures(self):
Undocumented
def _set_nominatedarchindep(self):
Undocumented
def _potential_nominated_arches(self, parent_list):
Undocumented
def _copy_packages(self):
Undocumented
def _use_cloner(self, target_archive, archive):
Returns True if it's safe to use the packagecloner (as opposed
to using the packagecopier).
We use two different ways to copy packages:
 - the packagecloner: fast but not conflict safe.
 - the packagecopier: slow but performs lots of checks to
 avoid creating conflicts.
1. We'll use the cloner:
If this is not a first initialization.
And If:
    1.a If the archives are different and the target archive is
        empty use the cloner.
    Or
    1.b. If the archives are the same and the target series is
        empty use the cloner.
2.  Otherwise use the copier.
def _create_source_names_by_parent(self):
If only a subset of the packagesets was selected to be copied, create a dict with the list of source names to be copied for each parent.

source_names_by_parent.get(parent) can be 3 different things: - None: this means that no specific packagesets where selected for the initialization. In this case we need to consider all the packages in this parent. - []: this means that some specific packagesets where selected for the initialization but none in this parent. We can skip this parent for all the copy/check operations. - [name1, ...]: this means that some specific packagesets were selected for the initialization and some are in this parent so the list of packages to consider in not empty.

def _copy_publishing_records(self, distroarchseries_lists):
Copy the publishing records from the parent arch series to the given arch series in ourselves.

We copy all PENDING and PUBLISHED records as PENDING into our own publishing records.

We copy only the RELEASE pocket in the PRIMARY archive.

def _rescore_rebuilds(self, builds):
Rescore the passed builds so that they have an appropriately low score.
def _copy_component_section_and_format_selections(self):
Copy the section, component and format selections from the parents distro series into this one.
def _copy_packaging_links(self):
Copy the packaging links from the parent series to this one.
def _copy_packagesets(self):
Copy packagesets from the parent distroseries.
def _copy_pocket_permissions(self):
Copy per-distroseries/pocket permissions from the parent series.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.