<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">&lt;<a href="mailto:cristiana.voicu@intel.com" target="_blank">cristiana.voicu@intel.com</a>&gt;</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+=&quot;toaster buildhistory&quot;<br>
To keep it simple, I&#39;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 &lt;<a href="mailto:cristiana.voicu@intel.com">cristiana.voicu@intel.com</a>&gt;<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 &quot;#added by toaster&quot; &gt;&gt; ${BUILDDIR}/conf/$2<br>
+        echo $1 &gt;&gt; ${BUILDDIR}/conf/$2<br>
+}<br>
+<br>
+function removefromConfiguration()<br>
+{<br>
+        comment_line=$(grep -n &quot;#added by toaster&quot; &quot;$file&quot; | cut -f1 -d:)<br>
+        variable_line=$((comment_line+1))<br>
+        lines=&quot;${comment_line},${variable_line}&quot;<br>
+        sed -i &quot;$lines&quot;&#39;d&#39; ${BUILDDIR}/conf/$1<br>
+}<br>
<br>
 # We make sure we&#39;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 &quot;INHERIT+=\&quot;toaster buildhistory\&quot;&quot; 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 &#39;{print $2}&#39; | grep &quot;[0-9]\+&quot; | 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>