コード例 #1
0
ファイル: options.py プロジェクト: ssato/packagemaker
    def test_05_parse_args_w_name_and_filelist_and_driver(self):
        name = "foo"
        driver = random.choice(
            [b for b in Backends.map().keys() if b != Backends.default()]
        )

        o = O.Options()
        (opts, args) = o.parse_args(
            ["-n", name, "--driver", driver, "dummy_filelist.txt"]
        )
        self.assertEquals(opts.driver, driver)
コード例 #2
0
ファイル: configurations.py プロジェクト: ssato/packagemaker
def _defaults(env):
    """
    Make a Bunch object holding default values and returns it.
    """
    defaults = B.Bunch()

    defaults.config = None
    defaults.norc = False
    defaults.force = False
    defaults.verbosity = 0  # verbose and debug option.
    defaults.trace = False
    defaults.log = None  # logging output file

    # build options:
    defaults.workdir = env.workdir
    defaults.stepto = env.upto

    # see pmaker.collectors.FilelistCollectors
    defaults.input_type = "filelist.plain"

    defaults.driver = Backends.default()  # e.g. "autotools.single.rpm"
    defaults.format = env.format
    defaults.destdir = ""
    defaults.template_paths = env.template_paths

    # package metadata options:
    defaults.name = None
    defaults.group = "System Environment/Base"
    defaults.license = "GPLv3+"
    defaults.url = "http://localhost.localdomain"
    defaults.summary = None
    defaults.compressor = env.compressor.extension  # extension
    defaults.arch = False
    defaults.relations = []
    defaults.packager = env.fullname
    defaults.email = env.email
    defaults.pversion = "0.0.1"
    defaults.release = "1"
    defaults.ignore_owner = False
    defaults.changelog = ""

    # rpm options:
    defaults.dist = env.dist.label
    defaults.no_rpmdb = env.format != G.PKG_FORMAT_RPM
    defaults.no_mock = False
    defaults.trigger = False

    # others:
    defaults.hostname = env.hostname

    return defaults