* [PATCH 0/1] Bug #645 fixing
@ 2011-01-07 6:29 Lianhao Lu
2011-01-07 6:29 ` [PATCH 1/1] bitbake/data.py: corrected the output for shell syntax Lianhao Lu
2011-01-07 11:15 ` [PATCH 0/1] Bug #645 fixing Richard Purdie
0 siblings, 2 replies; 3+ messages in thread
From: Lianhao Lu @ 2011-01-07 6:29 UTC (permalink / raw)
To: poky
Modified the function emit_var() in bitbake/lib/bb/data.py for Bug #645
1. added "#" for multiple line comment
2. added " \" for multiple line shell variable.
Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: llu/bug645
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/bug645
Thanks,
Lianhao Lu <lianhao.lu@intel.com>
---
Lianhao Lu (1):
bitbake/data.py: corrected the output for shell syntax.
bitbake/lib/bb/data.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] bitbake/data.py: corrected the output for shell syntax.
2011-01-07 6:29 [PATCH 0/1] Bug #645 fixing Lianhao Lu
@ 2011-01-07 6:29 ` Lianhao Lu
2011-01-07 11:15 ` [PATCH 0/1] Bug #645 fixing Richard Purdie
1 sibling, 0 replies; 3+ messages in thread
From: Lianhao Lu @ 2011-01-07 6:29 UTC (permalink / raw)
To: poky
[BUGID# 645], modify the emit_var()
1. Added "#" to the beginning of each line if the comment contains
multiple lines.
2. Added "\" to the end of each line if the shell variable value
contains multiple lines.
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
bitbake/lib/bb/data.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index 6ec522a..53ce7d6 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -192,7 +192,8 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False):
return 0
if all:
- o.write('# %s=%s\n' % (var, oval))
+ commentVal = re.sub('\n', '\n#', str(oval))
+ o.write('# %s=%s\n' % (var, commentVal))
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
@@ -219,6 +220,7 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False):
# 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())
+ alter = re.sub('\n', ' \\\n', alter)
o.write('%s="%s"\n' % (varExpanded, alter))
return 0
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 0/1] Bug #645 fixing
2011-01-07 6:29 [PATCH 0/1] Bug #645 fixing Lianhao Lu
2011-01-07 6:29 ` [PATCH 1/1] bitbake/data.py: corrected the output for shell syntax Lianhao Lu
@ 2011-01-07 11:15 ` Richard Purdie
1 sibling, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2011-01-07 11:15 UTC (permalink / raw)
To: Lianhao Lu; +Cc: poky
On Fri, 2011-01-07 at 14:29 +0800, Lianhao Lu wrote:
> Modified the function emit_var() in bitbake/lib/bb/data.py for Bug #645
>
> 1. added "#" for multiple line comment
> 2. added " \" for multiple line shell variable.
>
> Pull URL: git://git.pokylinux.org/poky-contrib.git
> Branch: llu/bug645
> Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/bug645
>
> Thanks,
> Lianhao Lu <lianhao.lu@intel.com>
> ---
>
>
> Lianhao Lu (1):
> bitbake/data.py: corrected the output for shell syntax.
>
> bitbake/lib/bb/data.py | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
Merged into Poky's master branch and applied to upstream bitbake too.
Cheers,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-07 11:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-07 6:29 [PATCH 0/1] Bug #645 fixing Lianhao Lu
2011-01-07 6:29 ` [PATCH 1/1] bitbake/data.py: corrected the output for shell syntax Lianhao Lu
2011-01-07 11:15 ` [PATCH 0/1] Bug #645 fixing Richard Purdie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.