~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/scripts/initialize_distroseries.py

  • Committer: Raphael Badin
  • Date: 2011-07-22 11:12:23 UTC
  • mto: This revision was merged to the branch mainline in revision 13505.
  • Revision ID: raphael.badin@canonical.com-20110722111223-1bwiuiub5coeldp4
Create DSDJs outside the packages copy loop.

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
        self._copy_architectures()
215
215
        self._copy_packages()
216
216
        self._copy_packagesets()
 
217
        self._create_dsds()
217
218
        self._set_initialized()
218
219
        transaction.commit()
219
220
 
253
254
                self.distroseries.previous_series)]
254
255
        return set(previous_series_parents) == set(self.parents)
255
256
 
256
 
    def _create_dsds(self, archive, names=None):
 
257
    def _create_dsds(self):
257
258
        if not self.first_derivation:
258
259
            if (self._has_same_parents_as_previous_series() and
259
260
                not self.packagesets):
267
268
                # previous_series's parents) or a selection only of the
268
269
                # packagesets is being copied so we have to recompute
269
270
                # the DSDs by creating DSD Jobs.
270
 
                self._create_dsd_jobs(archive, names)
 
271
                self._create_dsd_jobs()
271
272
        else:
272
273
            # If this is the first derivation, create the DSD Jobs.
273
 
            self._create_dsd_jobs(archive, names)
 
274
            self._create_dsd_jobs()
274
275
 
275
276
    def _copy_dsds_from_previous_series(self):
276
277
        self._store.execute("""
290
291
                self.distroseries.id,
291
292
                self.distroseries.previous_series.id))
292
293
 
293
 
    def _create_dsd_jobs(self, archive, names):
 
294
    def _create_dsd_jobs(self):
294
295
        job_source = getUtility(IDistroSeriesDifferenceJobSource)
295
296
        for parent in self.parents:
296
 
            job_source.massCreateForSeries(
297
 
                self.distroseries, parent, archive, names)
 
297
            job_source.massCreateForSeries(self.distroseries, parent)
298
298
 
299
299
    def _copy_configuration(self):
300
300
        self.distroseries.backports_not_automatic = any(
423
423
                    getUtility(IPackageCloner).clonePackages(
424
424
                        origin, destination, distroarchseries_list,
425
425
                        proc_families, spns, self.rebuild)
426
 
                    if spns:
427
 
                        self._create_dsds(target_archive, names=spns)
428
 
                    else:
429
 
                        self._create_dsds(target_archive)
430
426
                else:
431
427
                    # There is only one available pocket in an unreleased
432
428
                    # series.
442
438
                            sources, target_archive, self.distroseries,
443
439
                            pocket, include_binaries=not self.rebuild,
444
440
                            check_permissions=False, strict_binaries=False,
445
 
                            close_bugs=False)
 
441
                            close_bugs=False, create_dsd_job=False)
446
442
                        if self.rebuild:
447
443
                            for pubrec in sources_published:
448
444
                                pubrec.createMissingBuilds()
449
 
 
450
445
                    except CannotCopy, error:
451
446
                        raise InitializationError(error)
452
447