コード例 #1
0
ファイル: baker.py プロジェクト: diorcety/oe-lite-core
    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
コード例 #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
コード例 #3
0
ファイル: oven.py プロジェクト: KimBoendergaard/core
    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()
コード例 #4
0
ファイル: oven.py プロジェクト: Villemoes/oe-lite-core
    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()
コード例 #5
0
ファイル: baker.py プロジェクト: diorcety/oe-lite-core
                    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)
コード例 #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)