[PATCH openbmc] Add git version information to os-release

Patrick Williams patrick at stwcx.xyz
Sat Nov 14 03:37:18 AEDT 2015


Brad,

This will fail if you build from a tar/zip file.  Can you add a
fall-back if you are not building in a git repository?

On Wed, Nov 11, 2015 at 02:20:19PM -0500, OpenBMC Patches wrote:
> From: Brad Bishop <bradleyb at us.ibm.com>
> 
> VERSION_ID = `git tag`
> BUILD_ID = `git describe --dirty`
> ---
>  meta-phosphor/common/recipes-core/os-release/os-release.bbappend | 8 ++++++++
>  1 file changed, 8 insertions(+)
>  create mode 100644 meta-phosphor/common/recipes-core/os-release/os-release.bbappend
> 
> diff --git a/meta-phosphor/common/recipes-core/os-release/os-release.bbappend b/meta-phosphor/common/recipes-core/os-release/os-release.bbappend
> new file mode 100644
> index 0000000..1692af1
> --- /dev/null
> +++ b/meta-phosphor/common/recipes-core/os-release/os-release.bbappend
> @@ -0,0 +1,8 @@
> +def git_describe(d):
> +        return bb.process.run("git describe --dirty")[0]
> +def git_tag(d):
> +        return bb.process.run("git tag")[0]
> +
> +VERSION_ID = "${@git_tag(d)}"
> +BUILD_ID = "${@git_describe(d)}"
> +OS_RELEASE_FIELDS_append = " BUILD_ID"
> -- 
> 2.6.3
> 
> 
> _______________________________________________
> openbmc mailing list
> openbmc at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc

-- 
Patrick Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20151113/10e10100/attachment-0001.sig>


More information about the openbmc mailing list