Example #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
Example #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
Example #3
0
            if task.nostamp:
                self.runq.set_task_metahash(task, "0")
                task = self.runq.get_metahashable_task()
                count += 1
                continue

            dephashes = {}
            for depend in self.runq.task_dependencies(task, flatten=True):
                dephashes[depend] = self.runq.get_task_metahash(depend)
            try:
                recipe_extra_arch = recipe.meta.get("EXTRA_ARCH")
            except oelite.meta.ExpansionError as e:
                e.msg += " in %s"%(task)
                raise
            task_meta = task.meta()
            # FIXME: is this really needed?  How should the task metadata be
            # changed at this point?  isn't it created from recipe meta by the
            # task.meta() call above?
            if (recipe_extra_arch and
                task_meta.get("EXTRA_ARCH") != recipe_extra_arch):
                task_meta.set("EXTRA_ARCH", recipe_extra_arch)
            try:
                if self.options.dump_signature_metadata:
                    self.normpath(task.recipe.filename)
                    dump = os.path.join(self.options.dump_signature_metadata,
                                        self.normpath(task.recipe.filename),
                                        str(task))
                else:
                    dump = None
                datahash = task_meta.signature(dump=dump)
Example #4
0
            if task.nostamp:
                self.runq.set_task_metahash(task, "0")
                task = self.runq.get_metahashable_task()
                count += 1
                continue

            dephashes = {}
            for depend in self.runq.task_dependencies(task, flatten=True):
                dephashes[depend] = self.runq.get_task_metahash(depend)
            try:
                recipe_extra_arch = recipe.meta.get("EXTRA_ARCH")
            except oelite.meta.ExpansionError as e:
                e.msg += " in %s" % (task)
                raise
            task_meta = task.meta()
            # FIXME: is this really needed?  How should the task metadata be
            # changed at this point?  isn't it created from recipe meta by the
            # task.meta() call above?
            if (recipe_extra_arch
                    and task_meta.get("EXTRA_ARCH") != recipe_extra_arch):
                task_meta.set("EXTRA_ARCH", recipe_extra_arch)
            try:
                if self.options.dump_signature_metadata:
                    self.normpath(task.recipe.filename)
                    dump = os.path.join(self.options.dump_signature_metadata,
                                        self.normpath(task.recipe.filename),
                                        str(task))
                else:
                    dump = None
                datahash = task_meta.signature(dump=dump)