summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-29 16:24:26 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-29 18:22:13 +0000
commiteacedb4f2afa98dbd2f5ea7a9f52e6ea952a72d2 (patch)
tree33803723d5331fc592ad67ad55253cddc5114a7b /meta
parent17f2d5d70ad323cea4fb149154bc38844661fa3a (diff)
downloadopenembedded-core-eacedb4f2afa98dbd2f5ea7a9f52e6ea952a72d2.tar.gz
openembedded-core-eacedb4f2afa98dbd2f5ea7a9f52e6ea952a72d2.tar.bz2
openembedded-core-eacedb4f2afa98dbd2f5ea7a9f52e6ea952a72d2.tar.xz
openembedded-core-eacedb4f2afa98dbd2f5ea7a9f52e6ea952a72d2.zip
image_types: Correctness fixes
* Add a newline to improve the output formatting * Use set() to turn the list into a set of unique items to prevnt the same image code running twice (for e.g. IMAGE_FSTYPES = "tar.gz tar.bz2") * Support multiple compression extensions such as ".gz.u-boot" * Fix basetype/type typo and fix multiple image generation Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/image_types.bbclass9
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index a5f09fef4..5b48a09da 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -11,11 +11,12 @@ def get_imagecmds(d):
for type in types:
for ctype in ctypes:
if type.endswith("." + ctype):
- basetype = type.rsplit(".", 1)[0]
+ basetype = type[:-len("." + ctype)]
types[types.index(type)] = basetype
- if type not in cimages:
+ if basetype not in cimages:
cimages[basetype] = []
cimages[basetype].append(ctype)
+ break
# Live images will be processed via inheriting bbclass and
# does not get processed here.
@@ -28,7 +29,7 @@ def get_imagecmds(d):
if d.getVar('IMAGE_LINK_NAME', True):
cmds += " rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.*"
- for type in types:
+ for type in set(types):
ccmd = []
subimages = []
localdata = bb.data.createCopy(d)
@@ -47,7 +48,7 @@ def get_imagecmds(d):
localdata.setVar('subimages', " ".join(subimages))
cmd = localdata.getVar("IMAGE_CMD", True)
localdata.setVar('cmd', cmd)
- cmds += localdata.getVar("runimagecmd", True)
+ cmds += "\n" + localdata.getVar("runimagecmd", True)
return cmds
runimagecmd () {