1 DESCRIPTION
= "Runs a shell in an environment as emitted by BitBake to execute tasks"
5 inherit autotools pkgconfig
11 def devshell_emit_env
(o
, d
, all
=False, funcwhitelist
=None
):
12 """Emits all items in the data store in a format such that it can be sourced by a shell."""
17 if bb.
data.getVarFlag
(e
, "func", d
):
19 bb.
data.emit_var
(e
, o
, d
, all
) and o.
write('
\n'
)
22 if not bb.
data.getVarFlag
(e
, "func", d
):
25 bb.
data.emit_var
(e
, o
, d
) and o.
write('
\n'
)
27 for i in funcwhitelist
:
29 bb.
data.emit_var
(e
, o
, d
) and o.
write('
\n'
)
36 workdir
= bb.
data.getVar
('WORKDIR'
, d
, 1)
37 shellfile
= os.path.join
(workdir
, bb.
data.expand
("${TARGET_PREFIX}${DISTRO}-${MACHINE}-devshell", d
))
39 f
= open
(shellfile
, "w")
41 # emit variables
and shell functions
42 devshell_emit_env
(f
, d
, False, ["die", "oe", "autotools_do_configure"])
56 shellfile
="${TARGET_PREFIX}${DISTRO}-${MACHINE}-devshell"
61 echo
"#!/bin/bash --rcfile" > $shellfile
62 sed
-e
"s:${S}:.:g" -e
"s:exit 1:true:" tmpfile
>> $shellfile
64 echo
"export PS1='[OE::${TARGET_PREFIX}${DISTRO}-${MACHINE}]:\w\$ '" >> $shellfile
65 echo
"alias ./configure=oe_runconf" >> $shellfile
66 echo
"alias make=oe_runmake" >> $shellfile
68 mkdir
-p $
{DEPLOY_DIR
}/addons
69 install
-m
755 $shellfile $
{DEPLOY_DIR
}/addons
72 addtask deploy
after do_install
before do_package