~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

[r=julian-edwards][bug=797599] Do not duplicate Archive Permissions
        when we initialize a series.

Show diffs side-by-side

added added

removed removed

Lines of Context:
457
457
        packagesets = self._store.find(
458
458
            Packageset, DistroSeries.id.is_in(self.derivation_parent_ids))
459
459
        parent_to_child = {}
460
 
        # Create the packagesets, and any archivepermissions
 
460
        # Create the packagesets.
461
461
        parent_distro_ids = [
462
462
            parent.distribution.id for parent in self.derivation_parents]
463
463
        for parent_ps in packagesets:
479
479
                    parent_ps.name, parent_ps.description,
480
480
                    new_owner, distroseries=self.distroseries,
481
481
                    related_set=parent_ps)
482
 
            # XXX: 2011-06-15 rvb bug=797599.
483
 
            # Copying archivepermissions cross-distro is wrong.
484
 
            self._store.execute("""
485
 
                INSERT INTO Archivepermission
486
 
                (person, permission, archive, packageset, explicit)
487
 
                SELECT person, permission, %s, %s, explicit
488
 
                FROM Archivepermission WHERE packageset = %s
489
 
                """ % sqlvalues(
490
 
                    self.distroseries.main_archive, child_ps.id,
491
 
                    parent_ps.id))
 
482
 
492
483
            parent_to_child[parent_ps] = child_ps
493
484
        # Copy the relations between sets, and the contents.
494
485
        for old_series_ps, new_series_ps in parent_to_child.items():