summaryrefslogtreecommitdiff
path: root/packages/addons/devshell.bb
diff options
context:
space:
mode:
authorMichael Lauer <mickey@vanille-media.de>2005-08-19 15:41:09 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-08-19 15:41:09 +0000
commit5bc0fa0024337ba8bec582084cabf6b8171e1aaf (patch)
treeba84f7fc5a7bff6d6a27067cb7a7b069e8427326 /packages/addons/devshell.bb
parent70d68b647d317e0f110bb2a6ece9cf15e4f47fb4 (diff)
parent5eaa8411ffeee7de8124d2ca83cbd6527b60c2fb (diff)
merge of 69f5e6634ad41e14c392c5aca06f4c4516ab4f21
and e77aaa7cc80bddb255c4e859e17727dc070660df
Diffstat (limited to 'packages/addons/devshell.bb')
-rw-r--r--packages/addons/devshell.bb70
1 files changed, 70 insertions, 0 deletions
diff --git a/packages/addons/devshell.bb b/packages/addons/devshell.bb
new file mode 100644
index 0000000000..920ac00d10
--- /dev/null
+++ b/packages/addons/devshell.bb
@@ -0,0 +1,70 @@
+DESCRIPTION = "Runs a shell in an environment as emitted by BitBake to execute tasks"
+LICENSE = "GPL"
+MAINTAINER = "Rene Wagner <rw@handhelds.org>"
+
+inherit autotools pkgconfig
+
+do_configure() {
+ :
+}
+
+def devshell_emit_env(o, d, all=False, funcwhitelist=None):
+ """Emits all items in the data store in a format such that it can be sourced by a shell."""
+
+ import bb
+ import bb.data
+
+ env = bb.data.keys(d)
+
+ for e in env:
+ if bb.data.getVarFlag(e, "func", d):
+ continue
+ bb.data.emit_var(e, o, d, all) and o.write('\n')
+
+ for e in env:
+ if not bb.data.getVarFlag(e, "func", d):
+ continue
+ if not funcwhitelist:
+ bb.data.emit_var(e, o, d) and o.write('\n')
+ continue
+ for i in funcwhitelist:
+ if e.startswith(i):
+ bb.data.emit_var(e, o, d) and o.write('\n')
+ break
+
+python do_compile() {
+ import os
+ import os.path
+
+ workdir = bb.data.getVar('WORKDIR', d, 1)
+ shellfile = os.path.join(workdir, bb.data.expand("${TARGET_PREFIX}${DISTRO}-${MACHINE}-devshell", d))
+
+ f = open(shellfile, "w")
+
+ # emit variables and shell functions
+ devshell_emit_env(f, d, False, ["die", "oe", "autotools_do_configure"])
+
+ f.close()
+}
+
+do_install() {
+ :
+}
+
+do_stage() {
+ :
+}
+
+do_package() {
+ shellfile="${TARGET_PREFIX}${DISTRO}-${MACHINE}-devshell"
+
+ cd ${WORKDIR}
+
+ cp $shellfile tmpfile
+ echo "#!/bin/bash --rcfile" > $shellfile
+ sed -e "s:${S}:.:g" -e "s:exit 1:true:" tmpfile >> $shellfile
+ echo "export PS1='[OE::${TARGET_PREFIX}${DISTRO}-${MACHINE}]:\w\$ '" >> $shellfile
+
+ mkdir -p ${DEPLOY_DIR}/addons
+ install -m 755 $shellfile ${DEPLOY_DIR}/addons
+}