Esempio n. 1
0
    def getSoyuz(self, version=None, component=None, arch=None,
                 suite=None, distribution_name='ubuntu',
                 ppa=None, partner=False, ppa_name='ppa'):
        """Return a SoyuzScript instance.

        Allow tests to use a set of default options and pass an
        inactive logger to SoyuzScript.
        """
        test_args = ['-d', distribution_name, '-y']

        if suite is not None:
            test_args.extend(['-s', suite])

        if version is not None:
            test_args.extend(['-e', version])

        if arch is not None:
            test_args.extend(['-a', arch])

        if component is not None:
            test_args.extend(['-c', component])

        if ppa is not None:
            test_args.extend(['-p', ppa])
            test_args.extend(['--ppa-name', ppa_name])

        if partner:
            test_args.append('-j')

        soyuz = SoyuzScript(name='soyuz-script', test_args=test_args)
        # Store output messages, for future checks.
        soyuz.logger = BufferLogger()
        soyuz.setupLocation()
        return soyuz
Esempio n. 2
0
 def add_my_options(self):
     """Add -d, -s, dry-run and confirmation options."""
     SoyuzScript.add_distro_options(self)
     SoyuzScript.add_transaction_options(self)
    def add_my_options(self):
        """Parse command line arguments for copy archive creation/population.
        """
        SoyuzScript.add_my_options(self)

        self.parser.add_option(
            "-a", "--architecture", dest="arch_tags", action="append",
            help="The architecture tags for which to create build "
                 "records, repeat for each architecture required.")
        self.parser.add_option(
            "-b", "--include-binaries", dest="include_binaries",
            default=False, action="store_true",
            help='Whether to copy related binaries or not.')

        self.parser.add_option(
            '--from-archive', dest='from_archive', default=None,
            action='store', help='Origin archive name.')
        self.parser.add_option(
            '--from-distribution', dest='from_distribution',
            default='ubuntu', action='store',
            help='Origin distribution name.')
        self.parser.add_option(
            '--from-suite', dest='from_suite', default=None,
            action='store', help='Origin suite name.')
        self.parser.add_option(
            '--from-user', dest='from_user', default=None,
            action='store', help='Origin PPA owner name.')

        self.parser.add_option(
            '--to-distribution', dest='to_distribution',
            default='ubuntu', action='store',
            help='Destination distribution name.')
        self.parser.add_option(
            '--to-suite', dest='to_suite', default=None,
            action='store', help='Destination suite name.')

        self.parser.add_option(
            '--to-archive', dest='to_archive', default=None,
            action='store', help='Destination archive name.')

        self.parser.add_option(
            '--to-user', dest='to_user', default=None,
            action='store', help='Destination user name.')

        self.parser.add_option(
            "--reason", dest="reason",
            help="The reason for this packages copy operation.")

        self.parser.add_option(
            "--merge-copy", dest="merge_copy_flag",
            default=False, action="store_true",
            help='Repeated population of an existing copy archive.')

        self.parser.add_option(
            "--package-set-delta", dest="packageset_delta_flag",
            default=False, action="store_true",
            help=(
                'Only show packages that are fresher or new in origin '
                'archive. Destination archive must exist already.'))

        self.parser.add_option(
            "--package-set", dest="packageset_tags", action="append",
            help=(
                'Limit to copying packages in the selected packagesets.'))

        self.parser.add_option(
            "--nonvirtualized", dest="nonvirtualized", default=False,
            action="store_true",
            help='Create the archive as nonvirtual if specified.')
    def add_my_options(self):
        """Parse command line arguments for copy archive creation/population.
        """
        SoyuzScript.add_my_options(self)

        self.parser.add_option(
            "-a",
            "--architecture",
            dest="arch_tags",
            action="append",
            help="The architecture tags for which to create build "
            "records, repeat for each architecture required.")
        self.parser.add_option("-b",
                               "--include-binaries",
                               dest="include_binaries",
                               default=False,
                               action="store_true",
                               help='Whether to copy related binaries or not.')

        self.parser.add_option('--from-archive',
                               dest='from_archive',
                               default=None,
                               action='store',
                               help='Origin archive name.')
        self.parser.add_option('--from-distribution',
                               dest='from_distribution',
                               default='ubuntu',
                               action='store',
                               help='Origin distribution name.')
        self.parser.add_option('--from-suite',
                               dest='from_suite',
                               default=None,
                               action='store',
                               help='Origin suite name.')
        self.parser.add_option('--from-user',
                               dest='from_user',
                               default=None,
                               action='store',
                               help='Origin PPA owner name.')

        self.parser.add_option('--to-distribution',
                               dest='to_distribution',
                               default='ubuntu',
                               action='store',
                               help='Destination distribution name.')
        self.parser.add_option('--to-suite',
                               dest='to_suite',
                               default=None,
                               action='store',
                               help='Destination suite name.')

        self.parser.add_option('--to-archive',
                               dest='to_archive',
                               default=None,
                               action='store',
                               help='Destination archive name.')

        self.parser.add_option('--to-user',
                               dest='to_user',
                               default=None,
                               action='store',
                               help='Destination user name.')

        self.parser.add_option(
            "--reason",
            dest="reason",
            help="The reason for this packages copy operation.")

        self.parser.add_option(
            "--merge-copy",
            dest="merge_copy_flag",
            default=False,
            action="store_true",
            help='Repeated population of an existing copy archive.')

        self.parser.add_option(
            "--package-set-delta",
            dest="packageset_delta_flag",
            default=False,
            action="store_true",
            help=('Only show packages that are fresher or new in origin '
                  'archive. Destination archive must exist already.'))

        self.parser.add_option(
            "--package-set",
            dest="packageset_tags",
            action="append",
            help=('Limit to copying packages in the selected packagesets.'))

        self.parser.add_option(
            "--nonvirtualized",
            dest="nonvirtualized",
            default=False,
            action="store_true",
            help='Create the archive as nonvirtual if specified.')