~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/archivepublisher/publishing.py

[r=rvb][bug=905281] Skip publishing OBSOLETE and FUTURE series in
        PRIMARY and PARTNER archives.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    RepositoryIndexFile,
40
40
    )
41
41
from lp.registry.interfaces.pocket import PackagePublishingPocket
 
42
from lp.registry.interfaces.series import SeriesStatus
42
43
from lp.services.database.sqlbase import sqlvalues
43
44
from lp.services.librarian.client import LibrarianClient
44
45
from lp.services.utils import file_exists
236
237
        """
237
238
        self.log.debug("* Step A: Publishing packages")
238
239
 
239
 
        for distroseries in self.distro.series:
 
240
        if self.archive.purpose in (
 
241
            ArchivePurpose.PRIMARY,
 
242
            ArchivePurpose.PARTNER,
 
243
            ):
 
244
            # For PRIMARY and PARTNER archives, skip OBSOLETE and FUTURE
 
245
            # series.  We will never want to publish anything in them, so it
 
246
            # isn't worth thinking about whether they have pending
 
247
            # publications.
 
248
            consider_series = [
 
249
                series
 
250
                for series in self.distro.series
 
251
                if series.status not in (
 
252
                    SeriesStatus.OBSOLETE,
 
253
                    SeriesStatus.FUTURE,
 
254
                    )]
 
255
        else:
 
256
            # Other archives may have reasons to continue building at least
 
257
            # for OBSOLETE series.  For example, a PPA may be continuing to
 
258
            # provide custom builds for users who haven't upgraded yet.
 
259
            consider_series = self.distro.series
 
260
 
 
261
        for distroseries in consider_series:
240
262
            for pocket in self.archive.getPockets():
241
263
                allowed = (
242
264
                    not self.allowed_suites or