diff options
author | Richard Purdie <richard@openedhand.com> | 2007-08-03 13:40:52 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2007-08-03 13:40:52 +0000 |
commit | bfc70eb24e3ded25007811b1531673fa70b02401 (patch) | |
tree | fa4a29290d3178937fa085c147e8a51f815c6fdc /bitbake/lib/bb/data.py | |
parent | 034bbb805be0002fe6d689abde19662868b57b2c (diff) | |
download | openembedded-core-bfc70eb24e3ded25007811b1531673fa70b02401.tar.gz openembedded-core-bfc70eb24e3ded25007811b1531673fa70b02401.tar.bz2 openembedded-core-bfc70eb24e3ded25007811b1531673fa70b02401.zip |
bitbake: Update along 1.8 branch
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2345 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake/lib/bb/data.py')
-rw-r--r-- | bitbake/lib/bb/data.py | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index 14f1d896d7..9782c9f546 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py @@ -337,6 +337,12 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False): if getVarFlag(var, "python", d): return 0 + export = getVarFlag(var, "export", d) + unexport = getVarFlag(var, "unexport", d) + func = getVarFlag(var, "func", d) + if not all and not export and not unexport and not func: + return 0 + try: if all: oval = getVar(var, d, 0) @@ -362,28 +368,28 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False): if (var.find("-") != -1 or var.find(".") != -1 or var.find('{') != -1 or var.find('}') != -1 or var.find('+') != -1) and not all: return 0 + varExpanded = expand(var, d) + + if unexport: + o.write('unset %s\n' % varExpanded) + return 1 + val.rstrip() if not val: return 0 - - varExpanded = expand(var, d) - if getVarFlag(var, "func", d): -# NOTE: should probably check for unbalanced {} within the var + if func: + # NOTE: should probably check for unbalanced {} within the var o.write("%s() {\n%s\n}\n" % (varExpanded, val)) - else: - if getVarFlag(var, "unexport", d): - o.write('unset %s\n' % varExpanded) - return 1 - if getVarFlag(var, "export", d): - o.write('export ') - else: - if not all: - return 0 -# if we're going to output this within doublequotes, -# to a shell, we need to escape the quotes in the var - alter = re.sub('"', '\\"', val.strip()) - o.write('%s="%s"\n' % (varExpanded, alter)) + return 1 + + if export: + o.write('export ') + + # if we're going to output this within doublequotes, + # to a shell, we need to escape the quotes in the var + alter = re.sub('"', '\\"', val.strip()) + o.write('%s="%s"\n' % (varExpanded, alter)) return 1 |