summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-02-13 14:41:44 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-21 17:47:51 +0000
commit200159125eb6bcfc046c45cf5160b2eb340625e3 (patch)
tree1b9135ec91f716fdfa1057ba36000e6caa2a4c76 /meta
parent3fa9a7e4dc9eadce22a9838d2067d5af0111b04b (diff)
downloadopenembedded-core-200159125eb6bcfc046c45cf5160b2eb340625e3.tar.gz
openembedded-core-200159125eb6bcfc046c45cf5160b2eb340625e3.tar.bz2
openembedded-core-200159125eb6bcfc046c45cf5160b2eb340625e3.zip
classes/buildhistory: squash spaces out of image variables
Values of image variables that are lists (e.g. IMAGE_INSTALL) are easier to read if there are no extraneous spaces in them, so ensure that there is only one space between each item. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/buildhistory.bbclass16
1 files changed, 12 insertions, 4 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 1b6b2493e4..d1a9670c29 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -123,9 +123,6 @@ python buildhistory_emit_pkghistory() {
except EnvironmentError:
return None
- def squashspaces(string):
- return re.sub("\s+", " ", string)
-
def sortpkglist(string):
pkgiter = re.finditer(r'[a-zA-Z0-9.-]+( \([><=]+ [^ )]+\))?', string, 0)
pkglist = [p.group(0) for p in pkgiter]
@@ -349,12 +346,23 @@ def buildhistory_get_layers(d):
return layertext
+def squashspaces(string):
+ import re
+ return re.sub("\s+", " ", string).strip()
+
+
def buildhistory_get_imagevars(d):
imagevars = "DISTRO DISTRO_VERSION USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS ROOTFS_POSTPROCESS_COMMAND IMAGE_POSTPROCESS_COMMAND"
+ listvars = "USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS"
+ imagevars = imagevars.split()
+ listvars = listvars.split()
ret = ""
- for var in imagevars.split():
+ for var in imagevars:
value = d.getVar(var, True) or ""
+ if var in listvars:
+ # Squash out spaces
+ value = squashspaces(value)
ret += "%s = %s\n" % (var, value)
return ret.rstrip('\n')