Commit Graph

19 Commits

Author SHA1 Message Date
Joshua Lock 3c59b1bf93 meta: remove True option to getVarFlag calls
getVarFlag() now defaults to expanding by default, thus remove the
True option from getVarFlag() calls with a regex search and
replace.

Search made with the following regex:
getVarFlag ?\(( ?[^,()]*, ?[^,()]*), True\)

(From OE-Core rev: 2dea9e490a98377010b3d4118d054814c317a735)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Ed Bartosh e8feb1976a devpyshell: python3: flush stdout explicitly
Opening text stream in unbuffered mode raises the following
exception In Python 3:
    ValueError: can't have unbuffered text I/O

Fixed by leaving std* streams in text mode and flushing
stdout explicitly.

(From OE-Core rev: 732001cb268683f5b56e251e2964ec5b694a2147)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Ed Bartosh 250955ab8c devshell.bbclass: fix double unbuffering
stdout is already unbuffered in bitbake code. Attempt to
do it again in devshell.bbclass causes this crash when
running devpyshell:
  File "scripts/oepydevshell-internal.py", line 29, in <module>
      pty = open(sys.argv[1], "w+b", 0)
  IOError: [Errno 13] Permission denied: '/dev/pts/6'

(From OE-Core rev: 875910451e1ce97d0c42b41b1140c8160ed1f40a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Richard Purdie 7fa6eeba1c classes/lib: Add expand parameter to getVarFlag
This sets the scene for removing the default False for expansion
from getVarFlag. This would later allow True to become the default.

On the most part this is an automatic translation with:

sed -e 's:\(\.getVarFlag([^,()]*, [^,()]*\)):\1, True):g'  -i `grep -ril getVar *`

In this case, the default was False, but True was used since in most
cases here expansion would be expected.

(From OE-Core rev: 42a10788e89b07b14a150ced07113566cf99fcdd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-04 23:39:00 +00:00
Ross Burton 8a9ac1de34 devshell: allow the starting directory to be overridden
Some people like to have the devshell start in ${B} instead of ${S}, so allow
this to be overridden.

(From OE-Core rev: 217af639d13258429949b14c67110650288cba7a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-16 17:41:55 +00:00
Richard Purdie cd7b437d4b devshell: Add interactive python shell
Being able to interact with the python context in the Bitbake task execution
environment has long been desireable. This patch introduces such a
mechanism. Executing "bitbake X -c devpyshell" will open a terminal connected
to a python interactive interpretor in the task context so for example you can
run commands like "d.getVar('WORKDIR')"

This version now includes readline support for command history and various other
bug fixes such as exiting cleanly compared to previous versions.

(From OE-Core rev: 36734f34fe6e4b91e293234687e63c02f5b3117e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-28 08:27:00 +01:00
Richard Purdie 5963d24ec5 devshell: Don't corrupt the fakeroot variables
The devshell anonymous python fragment overwrites variables in the
datastore with their expanded versions. If this runs before the code
in allarch.bbclass which changes TARGET_OS, we can end up with different
directories in the fakeroot environment variables, some expanded with
the original TARGET_OS value.

The devshell code only needs to run before the task itself so we change
to trigger it to run at task execution time only using a flag.

[YOCTO #4795]

(From OE-Core rev: 56baf177cdf074929a090cc66a8b89d346a5d79c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-06 23:04:49 +01:00
Richard Purdie 1dc9e9c3c5 devshell.bbclass: Allow running devshell and fakeroot together
Currently its hard to run a devshell complete with fakeroot context. This
patch allows the fakeroot flag on the task to do this, as with any other
task. Since we may need to start X terminal applications, we need to
only start the fakeroot session on the final command, hence the hoops
this code jumps through.

As always with fakeroot, you can break out and run a command without
the fake permissions with syntax like "PSEUDO_UNLOAD=1 <command>"

[YOCTO #3374]

(From OE-Core rev: 0a2662a48eaf0487db043c348e2834bb9cdd0466)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-19 08:47:36 -08:00
Chris Larson 057cc1e816 Rework how the devshell functions
In the new implementation, each known terminal is defined as a class in
oe.terminal, as a subclass of bb.process.Popen.  terminal.bbclass wraps this
functionality, providing the metadata pieces.  It obeys the OE_TERMINAL
variable, which is a 'choice' typed variable.  This variable may be 'auto',
'none', or any of the names of the defined terminals.

When using 'auto', or requesting an unsupported terminal, we attempt to spawn
them in priority order until we get one that's available on this system (and
in the case of the X terminals, has DISPLAY defined).  The 'none' value is
used when we're doing things like automated builds, and want to ensure that no
terminal is *ever* spawned, under any circumstances.

Current available terminals:

    gnome
    konsole
    xterm
    rxvt
    screen

(From OE-Core rev: 69f77f80965fa06a057837f8f49eda06855c4086)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-10 13:33:07 +01:00
Joshua Lock 6d261a50ba Ensure Bash is used when spawning terminals
We rely on Bashisms when spawning a terminal so ensure that bash is used
when using devshell and menuconfig.

Fixes [BUGID #119]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-02-24 15:54:09 +00:00
Richard Purdie c91caeea89 devshell: Clean up devshell code so this task doesn't polute the global namespace
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-09 13:16:32 +00:00
Richard Purdie 5977534d5f devshell.bbclass: export the FAKEROOTENV so it can be accessed within the devshell task
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-23 13:04:03 +01:00
Richard Purdie 9a2f361a59 devshell.bbclass: Merge tweaks from OE.dev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-18 11:41:44 +00:00
Richard Purdie b85bc2744a devshell.bbclass: Export needed variables
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4526 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-05-21 20:19:01 +00:00
Richard Purdie 51d9c76e95 devshell.bbclass: Sync with OE since this no longer works at properly without this change
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2738 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-09-17 08:14:16 +00:00
Richard Purdie e09dab0614 classes: Sync with OE - mainly quoting fixes or other minor updates
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@885 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-20 15:19:39 +00:00
Richard Purdie c48931146d devshell.bbclass: Run after do_patch
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@684 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-08-31 08:19:26 +00:00
Richard Purdie b9f06d1671 devshell: Convert to its own class and add to poky.conf by default. Export EXTRA_OEMAKE to devshell.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@683 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-08-30 22:11:12 +00:00