summaryrefslogtreecommitdiffstats
path: root/meta/classes/buildhistory.bbclass
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:59:37 +0000
commit7b3ea97051cf2e3990e4dac5a4b0ac9a539c3227 (patch)
tree4d528fb498163710acc48b180fab06ebb5cf7818 /meta/classes/buildhistory.bbclass
parent9eab86041f8dfa171b0f106a05a7416e4f42ca8f (diff)
downloadpoky-7b3ea97051cf2e3990e4dac5a4b0ac9a539c3227.tar.gz
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. (From OE-Core rev: 200159125eb6bcfc046c45cf5160b2eb340625e3) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/buildhistory.bbclass')
-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() {
123 except EnvironmentError: 123 except EnvironmentError:
124 return None 124 return None
125 125
126 def squashspaces(string):
127 return re.sub("\s+", " ", string)
128
129 def sortpkglist(string): 126 def sortpkglist(string):
130 pkgiter = re.finditer(r'[a-zA-Z0-9.-]+( \([><=]+ [^ )]+\))?', string, 0) 127 pkgiter = re.finditer(r'[a-zA-Z0-9.-]+( \([><=]+ [^ )]+\))?', string, 0)
131 pkglist = [p.group(0) for p in pkgiter] 128 pkglist = [p.group(0) for p in pkgiter]
@@ -349,12 +346,23 @@ def buildhistory_get_layers(d):
349 return layertext 346 return layertext
350 347
351 348
349def squashspaces(string):
350 import re
351 return re.sub("\s+", " ", string).strip()
352
353
352def buildhistory_get_imagevars(d): 354def buildhistory_get_imagevars(d):
353 imagevars = "DISTRO DISTRO_VERSION USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS ROOTFS_POSTPROCESS_COMMAND IMAGE_POSTPROCESS_COMMAND" 355 imagevars = "DISTRO DISTRO_VERSION USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS ROOTFS_POSTPROCESS_COMMAND IMAGE_POSTPROCESS_COMMAND"
356 listvars = "USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS"
354 357
358 imagevars = imagevars.split()
359 listvars = listvars.split()
355 ret = "" 360 ret = ""
356 for var in imagevars.split(): 361 for var in imagevars:
357 value = d.getVar(var, True) or "" 362 value = d.getVar(var, True) or ""
363 if var in listvars:
364 # Squash out spaces
365 value = squashspaces(value)
358 ret += "%s = %s\n" % (var, value) 366 ret += "%s = %s\n" % (var, value)
359 return ret.rstrip('\n') 367 return ret.rstrip('\n')
360 368