Exemplo n.º 1
0
    def show(self):

        if len(self.things_todo) == 0:
            die("you must specify something to show")
        if len(self.recipes_todo) > 0:
            die("you cannot show world")

        thing = oelite.item.OEliteItem(self.things_todo[0])
        recipe = self.cookbook.get_recipe(
            type=thing.type, name=thing.name, version=thing.version,
            strict=False)
        if not recipe:
            die("Cannot find %s"%(thing))

        if self.options.task:
            if self.options.task.startswith("do_"):
                task = self.options.task
            else:
                task = "do_" + self.options.task
            self.runq = OEliteRunQueue(self.config, self.cookbook)
            self.runq._add_recipe(recipe, task)
            task = self.cookbook.get_task(recipe=recipe, name=task)
            task.prepare(self.runq)
            meta = task.meta()
        else:
            meta = recipe.meta

        #meta.dump(pretty=False, nohash=False, flags=True,
        #          ignore_flags=("filename", "lineno"),
        meta.dump(pretty=True, nohash=(not self.options.nohash),
                  only=(self.things_todo[1:] or None))

        return 0
Exemplo n.º 2
0
    def show(self):

        if len(self.things_todo) == 0:
            die("you must specify something to show")
        if len(self.recipes_todo) > 0:
            die("you cannot show world")

        thing = oelite.item.OEliteItem(self.things_todo[0])
        recipe = self.cookbook.get_recipe(type=thing.type,
                                          name=thing.name,
                                          version=thing.version,
                                          strict=False)
        if not recipe:
            die("Cannot find %s" % (thing))

        if self.options.task:
            if self.options.task.startswith("do_"):
                task = self.options.task
            else:
                task = "do_" + self.options.task
            self.runq = OEliteRunQueue(self.config, self.cookbook)
            self.runq._add_recipe(recipe, task)
            task = self.cookbook.get_task(recipe=recipe, name=task)
            task.prepare(self.runq)
            meta = task.meta()
        else:
            meta = recipe.meta

        #meta.dump(pretty=False, nohash=False, flags=True,
        #          ignore_flags=("filename", "lineno"),
        meta.dump(pretty=True,
                  nohash=(not self.options.nohash),
                  only=(self.things_todo[1:] or None))

        return 0
Exemplo n.º 3
0
    def start(self, task):
        self.count += 1
        debug("")
        debug("Preparing %s" % (task))
        task.prepare()
        info("%s started - %d / %d " % (task, self.count, self.total))
        task.build_started()

        self.add(task)
        task.start()
Exemplo n.º 4
0
    def start(self, task):
        self.count += 1
        debug("")
        debug("Preparing %s"%(task))
        task.prepare()
        info("%s started - %d / %d "%(task, self.count, self.total))
        task.build_started()

        self.add(task)
        task.start()
Exemplo n.º 5
0
                    info("Maybe next time")
                    return 0

        # FIXME: add some kind of statistics, with total_tasks,
        # prebaked_tasks, running_tasks, failed_tasks, done_tasks
        task = self.runq.get_runabletask()
        start = datetime.datetime.now()
        total = self.runq.number_of_tasks_to_build()
        count = 0
        exitcode = 0
        failed_task_list = []
        while task:
            count += 1
            debug("")
            debug("Preparing %s"%(task))
            task.prepare(self.runq)
            meta = task.meta()
            info("Running %d / %d %s"%(count, total, task))
            task.build_started()
            if self.options.fake_build or task.run():
                task.build_done(self.runq.get_task_buildhash(task))
                self.runq.mark_done(task)
            else:
                err("%s failed"%(task))
                exitcode = 1
                failed_task_list.append(task)
                task.build_failed()
                # FIXME: support command-line option to abort on first
                # failed task
            task = self.runq.get_runabletask()
        timing_info("Build", start)
Exemplo n.º 6
0
                    info("Maybe next time")
                    return 0

        # FIXME: add some kind of statistics, with total_tasks,
        # prebaked_tasks, running_tasks, failed_tasks, done_tasks
        task = self.runq.get_runabletask()
        start = datetime.datetime.now()
        total = self.runq.number_of_tasks_to_build()
        count = 0
        exitcode = 0
        failed_task_list = []
        while task:
            count += 1
            debug("")
            debug("Preparing %s" % (task))
            task.prepare(self.runq)
            meta = task.meta()
            info("Running %d / %d %s" % (count, total, task))
            task.build_started()
            if self.options.fake_build or task.run():
                task.build_done(self.runq.get_task_buildhash(task))
                self.runq.mark_done(task)
            else:
                err("%s failed" % (task))
                exitcode = 1
                failed_task_list.append(task)
                task.build_failed()
                # FIXME: support command-line option to abort on first
                # failed task
            task = self.runq.get_runabletask()
        timing_info("Build", start)