[oe-commits] [bitbake] 01/02: data: show value in -e when unexported
git at git.openembedded.org
git at git.openembedded.org
Sun Mar 11 13:37:59 UTC 2018
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository bitbake.
commit 7bc20dd3b0423fe543c4b0950fa2f4d5a3f81de1
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Wed Mar 7 17:35:38 2018 +0000
data: show value in -e when unexported
When a value has been unexported it still has a value, so write it out in a
comment to keep the output shell-like.
Signed-off-by: Ross Burton <ross.burton at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/data.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/bb/data.py b/lib/bb/data.py
index 80a7879..62fef18 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -156,10 +156,6 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False):
varExpanded = d.expand(var)
- if unexport:
- o.write('unset %s\n' % varExpanded)
- return False
-
if val is None:
return False
@@ -178,15 +174,19 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False):
o.write("%s() {\n%s\n}\n" % (varExpanded, val))
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)
alter = re.sub('\n', ' \\\n', alter)
alter = re.sub('\\$', '\\\\$', alter)
- o.write('%s="%s"\n' % (varExpanded, alter))
+
+ if unexport:
+ o.write('unset %s # "%s"\n' % (varExpanded, alter))
+ elif export:
+ o.write('export %s="%s"\n' % (varExpanded, alter))
+ else:
+ o.write('%s="%s"\n' % (varExpanded, alter))
+
return False
def emit_env(o=sys.__stdout__, d = init(), all=False):
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list