[bitbake-devel] [PATCH] toaster: set INHERIT var in the script that starts toaster

Alex Damian alex.r.damian at gmail.com
Wed Oct 30 15:37:28 UTC 2013


Taken in toaster/master.


On Mon, Oct 28, 2013 at 11:28 AM, Cristiana Voicu <cristiana.voicu at intel.com
> wrote:

> In order to use toaster, now you have to set INHERIT+="toaster
> buildhistory"
> To keep it simple, I've done some changes in order to automate it. When
> toaster
> is started, this line is added to local.conf. When it is stoped, it is
> removed.
>
> Signed-off-by: Cristiana Voicu <cristiana.voicu at intel.com>
> ---
>  bitbake/bin/toaster |   17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
> index 16de52b..639b7b7 100755
> --- a/bitbake/bin/toaster
> +++ b/bitbake/bin/toaster
> @@ -49,6 +49,21 @@ function webserverStartAll()
>          return $retval
>  }
>
> +#Helper functions to add/remove a line from a configuration file
> +
> +function addtoConfiguration()
> +{
> +        echo "#added by toaster" >> ${BUILDDIR}/conf/$2
> +        echo $1 >> ${BUILDDIR}/conf/$2
> +}
> +
> +function removefromConfiguration()
> +{
> +        comment_line=$(grep -n "#added by toaster" "$file" | cut -f1 -d:)
> +        variable_line=$((comment_line+1))
> +        lines="${comment_line},${variable_line}"
> +        sed -i "$lines"'d' ${BUILDDIR}/conf/$1
> +}
>
>  # We make sure we're running in the current shell and in a good
> environment
>
> @@ -120,6 +135,7 @@ fi
>
>  case $CMD in
>      start )
> +        addtoConfiguration "INHERIT+=\"toaster buildhistory\"" local.conf
>          webserverStartAll || return 4
>          unset BBSERVER
>          bitbake --server-only -t xmlrpc -B localhost:8200
> @@ -138,6 +154,7 @@ case $CMD in
>          webserverKillAll
>          # force stop any misbehaving bitbake server
>          lsof bitbake.lock | awk '{print $2}' | grep "[0-9]\+" | xargs -n1
> -r kill
> +        removefromConfiguration local.conf
>      ;;
>  esac
>
> --
> 1.7.9.5
>
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20131030/121699a3/attachment-0002.html>


More information about the bitbake-devel mailing list