def main(argv):
    options, action_tree_args = parse_options(argv[1:])
    env = release.get_env_from_options(options)
    git_repository_path = options.git_repository
    if git_repository_path is None:
        git_repository_path = os.getcwd()
    releaser = Releaser(env, git_repository_path, options.release_area,
                        options.in_repository)
    action_tree.action_main(releaser.all, action_tree_args)
Example #2
0
def main(argv):
    if not hasattr(action_tree, "action_main"):
        sys.exit("failed to import required modules")

    options, action_tree_args = parse_options(argv[1:])
    env = release.get_env_from_options(options)
    releaser = Releaser(env, options.git_repository_path, options.release_area,
                        options.mirror_path, options.build_tools_repository,
                        options.in_repository, options.tag_name, options.uri)
    action_tree.action_main(releaser.all, action_tree_args)
Example #3
0
def main(argv):
    parser = optparse.OptionParser()
    parser.add_option("--log-dir", dest="log_dir")
    options, args = parser.parse_args(argv)

    chroots = chroot_build.ChrootSet(chroot_build_config.ChrootConfig())
    if options.log_dir is None:
        log = build_log.DummyLogWriter()
    else:
        logset = build_log.LogSetDir(options.log_dir)
        log = logset.make_logger()
    action_tree.action_main(chroots.incremental_autobuild, args, log=log)
Example #4
0
    def test_logging_enrol_up_front(self):
        tree = TreeWithFailure().all_steps
        log = SimpleLog()
        try:
            action_tree.action_main(tree, ["0"], log=log)
        except:
            pass
        assert_equals(iostring(log.format), """\
top [None]
  failer [1]
  subtree [None]
    leaf1 [None]
    leaf2 [None]
""")
Example #5
0
    def test_logging(self):
        tree = ExampleTree().all_steps
        log = SimpleLog()
        action_tree.action_main(tree, ["0"], log=log)
        assert_equals(iostring(log.format), """\
top [None]
  subtree1 [0]
    foo [0]
    bar [0]
    baz [0]
  subtree2 [0]
    qux [0]
    quux [0]
""")
Example #6
0
    def test_formatting(self):
        tree = ExampleTree().all_steps
        stream = StringIO.StringIO()
        action_tree.action_main(tree, [], stdout=stream)
        assert_equals(stream.getvalue(), """\
0: all_steps
  1: subtree1
    2: foo
    3: bar
    4: baz
  5: subtree2
    6: qux
    7: quux
""")

        stream = StringIO.StringIO()
        action_tree.action_main(tree, ["-f", "subtree2"], stdout=stream)
        assert_equals(stream.getvalue(), """\
0: all_steps
  1: subtree2
    2: qux
    3: quux
""")
Example #7
0
    def test_running_subtrees(self):
        example = ExampleTree()
        # By number
        action_tree.action_main(example.all_steps, ["0"])
        self.assertEquals(pop_all(example.got),
                          ["foo", "bar", "baz", "qux", "quux"])
        action_tree.action_main(example.all_steps, ["1"])
        self.assertEquals(pop_all(example.got), ["foo", "bar", "baz"])
        action_tree.action_main(example.all_steps, ["2"])
        self.assertEquals(pop_all(example.got), ["foo"])
        action_tree.action_main(example.all_steps, ["3"])
        self.assertEquals(pop_all(example.got), ["bar"])
        action_tree.action_main(example.all_steps, ["-t", "3"])
        self.assertEquals(pop_all(example.got), ["bar", "baz", "qux", "quux"])
        action_tree.action_main(example.all_steps, ["-t", "5"])
        self.assertEquals(pop_all(example.got), ["qux", "quux"])
        # By name
        action_tree.action_main(example.all_steps, ["subtree1"])
        self.assertEquals(pop_all(example.got), ["foo", "bar", "baz"])
        action_tree.action_main(example.all_steps, ["foo"])
        self.assertEquals(pop_all(example.got), ["foo"])
        action_tree.action_main(example.all_steps, ["bar"])
        self.assertEquals(pop_all(example.got), ["bar"])

        action_tree.action_main(example.all_steps, ["-t", "bar"])
        self.assertEquals(pop_all(example.got), ["bar", "baz", "qux", "quux"])
        action_tree.action_main(example.all_steps, ["-t", "subtree2"])
        self.assertEquals(pop_all(example.got), ["qux", "quux"])

        action_tree.action_main(example.all_steps, ["-f", "subtree1", "0"])
        self.assertEquals(pop_all(example.got), ["foo", "bar", "baz"])
        action_tree.action_main(example.all_steps, ["-f", "-bar", "0"])
        self.assertEquals(pop_all(example.got), ["foo", "baz", "qux", "quux"])
def main(args):
    base_dir = os.getcwd()
    top = build.all_mods(base_dir, use_shared_prefix=False)
    action_tree.action_main(top, args)
def main(argv):
    options, action_tree_args = parse_options(argv[1:])
    env = release.get_env_from_options(options)
    actions = PbuilderActions(env, options.work_dir, lambda: options.deb_path)
    action_tree.action_main(actions.all, action_tree_args)