From 42c341cbb999f8da3eeab067b5c6f0ca7d5c00a8 Mon Sep 17 00:00:00 2001 From: brl Date: Tue, 12 Dec 2017 15:28:19 -0500 Subject: [PATCH] Added showvars utility class for debugging. Class can be added to any recipe and will create a target called 'showvars' which will dump out all of the variable values in a much simpler list than 'bitbake -e' --- meta-citadel-distro/classes/showvars.bbclass | 17 +++++++++++++++++ .../recipes-misc/showvars/showvars.bb | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 meta-citadel-distro/classes/showvars.bbclass create mode 100644 meta-citadel-distro/recipes-misc/showvars/showvars.bb diff --git a/meta-citadel-distro/classes/showvars.bbclass b/meta-citadel-distro/classes/showvars.bbclass new file mode 100644 index 0000000..18f8163 --- /dev/null +++ b/meta-citadel-distro/classes/showvars.bbclass @@ -0,0 +1,17 @@ + +addtask showvars + +do_showvars[nostamp] = "1" + +python do_showvars() { + # emit only the metadata that are variables but not functions + isfunc = lambda key: bool(d.getVarFlag(key, 'func')) + vars = sorted((key for key in bb.data.keys(d) if not key.startswith('__'))) + for var in vars: + if not isfunc(var): + try: + val = d.getVar(var, True) + except Exception as exc: + bb.plain('Expansion of %s threw %s: %s' % (var, exc.__class__.__name__, str(exc))) + bb.plain('%s="%s"' % (var,val)) +} diff --git a/meta-citadel-distro/recipes-misc/showvars/showvars.bb b/meta-citadel-distro/recipes-misc/showvars/showvars.bb new file mode 100644 index 0000000..115e4fc --- /dev/null +++ b/meta-citadel-distro/recipes-misc/showvars/showvars.bb @@ -0,0 +1,17 @@ + +SUMMARY = "Display variables" +LICENSE = "MIT" + + +INHIBIT_DEFAULT_DEPS = "1" +PACKAGES = "" + +deltask do_fetch +deltask do_unpack +deltask do_patch +deltask do_configure +deltask do_compile +deltask do_install +deltask do_populate_sysroot + +inherit showvars nopackages