<div dir="ltr">Taken in toaster/master.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 28, 2013 at 11:28 AM, Cristiana Voicu <span dir="ltr"><<a href="mailto:cristiana.voicu@intel.com" target="_blank">cristiana.voicu@intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In order to use toaster, now you have to set INHERIT+="toaster buildhistory"<br>
To keep it simple, I've done some changes in order to automate it. When toaster<br>
is started, this line is added to local.conf. When it is stoped, it is removed.<br>
<br>
Signed-off-by: Cristiana Voicu <<a href="mailto:cristiana.voicu@intel.com">cristiana.voicu@intel.com</a>><br>
---<br>
bitbake/bin/toaster | 17 +++++++++++++++++<br>
1 file changed, 17 insertions(+)<br>
<br>
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster<br>
index 16de52b..639b7b7 100755<br>
--- a/bitbake/bin/toaster<br>
+++ b/bitbake/bin/toaster<br>
@@ -49,6 +49,21 @@ function webserverStartAll()<br>
return $retval<br>
}<br>
<br>
+#Helper functions to add/remove a line from a configuration file<br>
+<br>
+function addtoConfiguration()<br>
+{<br>
+ echo "#added by toaster" >> ${BUILDDIR}/conf/$2<br>
+ echo $1 >> ${BUILDDIR}/conf/$2<br>
+}<br>
+<br>
+function removefromConfiguration()<br>
+{<br>
+ comment_line=$(grep -n "#added by toaster" "$file" | cut -f1 -d:)<br>
+ variable_line=$((comment_line+1))<br>
+ lines="${comment_line},${variable_line}"<br>
+ sed -i "$lines"'d' ${BUILDDIR}/conf/$1<br>
+}<br>
<br>
# We make sure we're running in the current shell and in a good environment<br>
<br>
@@ -120,6 +135,7 @@ fi<br>
<br>
case $CMD in<br>
start )<br>
+ addtoConfiguration "INHERIT+=\"toaster buildhistory\"" local.conf<br>
webserverStartAll || return 4<br>
unset BBSERVER<br>
bitbake --server-only -t xmlrpc -B localhost:8200<br>
@@ -138,6 +154,7 @@ case $CMD in<br>
webserverKillAll<br>
# force stop any misbehaving bitbake server<br>
lsof bitbake.lock | awk '{print $2}' | grep "[0-9]\+" | xargs -n1 -r kill<br>
+ removefromConfiguration local.conf<br>
;;<br>
esac<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.7.9.5<br>
<br>
_______________________________________________<br>
bitbake-devel mailing list<br>
<a href="mailto:bitbake-devel@lists.openembedded.org">bitbake-devel@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/bitbake-devel" target="_blank">http://lists.openembedded.org/mailman/listinfo/bitbake-devel</a><br>
</font></span></blockquote></div><br></div>