All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] terminal.bbclass: do not export PS1
@ 2014-01-10 14:58 Anders Darander
  2014-01-10 14:59 ` [PATCH 1/1] " Anders Darander
  0 siblings, 1 reply; 3+ messages in thread
From: Anders Darander @ 2014-01-10 14:58 UTC (permalink / raw)
  To: openembedded-core; +Cc: Anders Darander

terminal.bbclass: do not export PS1
   
With a complex PS1 setup, PS1 might not have all characters correctly escaped
when terminal.bbclass writes the export. This caused the run.do_terminal.PID to
terminate, making it impossible to use the devshell.
    
As the spawned shell will parse e.g. .bashrc (or whatever rc-file is being
used), PS1 will be reset in the devshell.
The following changes since commit 1028ac813fa9803ebfff6bcfa7f8b67012609b27:

  sstate: add do_package to the noexec list in setscene_depvalid (2014-01-07 13:58:28 +0000)

are available in the git repository at:

  git://github.com/darander/oe-core terminal.bbclass
  https://github.com/darander/oe-core/tree/terminal.bbclass

Anders Darander (1):
  terminal.bbclass: do not export PS1

 meta/classes/terminal.bbclass | 4 ++++
 1 file changed, 4 insertions(+)

-- 
1.8.5.2



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] terminal.bbclass: do not export PS1
  2014-01-10 14:58 [PATCH 0/1] terminal.bbclass: do not export PS1 Anders Darander
@ 2014-01-10 14:59 ` Anders Darander
  2014-01-10 15:26   ` Enrico Scholz
  0 siblings, 1 reply; 3+ messages in thread
From: Anders Darander @ 2014-01-10 14:59 UTC (permalink / raw)
  To: openembedded-core; +Cc: Anders Darander

With a complex PS1 setup, PS1 might not have all characters correctly escaped
when terminal.bbclass writes the export. This caused the run.do_terminal.PID to
terminate, making it impossible to use the devshell.

As the spawned shell will parse e.g. .bashrc (or whatever rc-file is being
used), PS1 will be reset in the devshell.

Signed-off-by: Anders Darander <anders@chargestorm.se>
---
 meta/classes/terminal.bbclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass
index 774f055..e577c6d 100644
--- a/meta/classes/terminal.bbclass
+++ b/meta/classes/terminal.bbclass
@@ -64,6 +64,10 @@ def oe_terminal(command, title, d):
             envdata.setVar(key, str(value))
             envdata.setVarFlag(key, 'export', 1)
 
+    # A complex PS1 might need more escaping of chars.
+    # Lets not export PS1 instead.
+    envdata.delVar("PS1")
+
     # Replace command with an executable wrapper script
     command = emit_terminal_func(command, envdata, d)
 
-- 
1.8.5.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] terminal.bbclass: do not export PS1
  2014-01-10 14:59 ` [PATCH 1/1] " Anders Darander
@ 2014-01-10 15:26   ` Enrico Scholz
  0 siblings, 0 replies; 3+ messages in thread
From: Enrico Scholz @ 2014-01-10 15:26 UTC (permalink / raw)
  To: openembedded-core

Anders Darander <anders-7UjN0b3lYz2SbKU13Z4Etw@public.gmane.org> writes:

> With a complex PS1 setup, PS1 might not have all characters correctly
> escaped

I think, this must be solved in other layers (bitbake?).  Using
'pipes.quote()' seems to be a proper way to escape things correctly.


Enrico


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-10 15:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-10 14:58 [PATCH 0/1] terminal.bbclass: do not export PS1 Anders Darander
2014-01-10 14:59 ` [PATCH 1/1] " Anders Darander
2014-01-10 15:26   ` Enrico Scholz

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.