~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

[r=jelmer][ui=None] Add a --nonvirtualized parameter to
        populate-archive.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
        self, from_archive, from_distribution, from_suite, from_user,
54
54
        component, to_distribution, to_suite, to_archive, to_user, reason,
55
55
        include_binaries, arch_tags, merge_copy_flag,
56
 
        packageset_delta_flag):
 
56
        packageset_delta_flag, nonvirtualized):
57
57
        """Create archive, populate it with packages and builds.
58
58
 
59
59
        Please note: if a component was specified for the origin then the
206
206
            # before the switch is flipped and build activity starts.
207
207
            # Also, builds for copy archives should default to using
208
208
            # virtual builders.
 
209
            virtual = not nonvirtualized
209
210
            copy_archive = getUtility(IArchiveSet).new(
210
211
                ArchivePurpose.COPY, registrant, name=to_archive,
211
212
                distribution=the_destination.distribution,
212
 
                description=reason, enabled=False, require_virtualized=True)
 
213
                description=reason, enabled=False,
 
214
                require_virtualized=virtual)
213
215
            the_destination.archive = copy_archive
214
216
            # Associate the newly created copy archive with the processor
215
217
            # families specified by the user.
310
312
            raise SoyuzScriptError(
311
313
                "Invalid origin archive name: '%s'" % opts.from_archive)
312
314
 
 
315
        # For the love of $DEITY, WTF doesn't this method just accept a
 
316
        # single parameter "opts" ...
313
317
        self.populateArchive(
314
318
            opts.from_archive, opts.from_distribution, opts.from_suite,
315
319
            opts.from_user, opts.component, opts.to_distribution,
316
320
            opts.to_suite, opts.to_archive, opts.to_user, opts.reason,
317
321
            opts.include_binaries, opts.arch_tags, opts.merge_copy_flag,
318
 
            opts.packageset_delta_flag)
 
322
            opts.packageset_delta_flag, opts.nonvirtualized)
319
323
 
320
324
    def add_my_options(self):
321
325
        """Parse command line arguments for copy archive creation/population.
379
383
                'Only show packages that are fresher or new in origin '
380
384
                'archive. Destination archive must exist already.'))
381
385
 
 
386
        self.parser.add_option(
 
387
            "--nonvirtualized", dest="nonvirtualized", default=False,
 
388
            action="store_true",
 
389
            help='Create the archive as nonvirtual if specified.')
 
390
 
382
391
    def _createMissingBuilds(
383
392
        self, distroseries, archive, proc_families):
384
393
        """Create builds for all cloned source packages.