[yocto] [yocto-autobuilder][PATCH] buildsteps/CheckOutLayers: use a commit object for git rev-parse

Flanagan, Elizabeth elizabeth.flanagan at intel.com
Thu Oct 17 12:52:51 PDT 2013


Stefan,

I'm pulling this patch, as this is part of our override of
parseGotRevision in buildbot/steps/source/git.py, but I'd also suggest
that this get suggested to the buildbot project for the original
parseGotRevision.

-b

On Thu, Oct 10, 2013 at 6:18 AM, Stefan Stanacar
<stefanx.stanacar at intel.com> wrote:
> When the object passed to git rev-parse is a tag, we need to dereference
> the tag until a commit id is found or the object cannot be dereferenced
> anymore hence add ^0. (<rev>^0 is a short-hand for <rev>^{commit})
>
> This avoids confusing tarballs like
> http://autobuilder.yoctoproject.org/pub/releases/dora-10.0.0/poky-319e24a8b1e100e950b07bbcad5fc81c42396845.tar.bz2
> which have the SHA-1 hash of the tag instead of the commit.
> It was first mentioned here
> https://lists.yoctoproject.org/pipermail/yocto/2013-October/018607.html
>
> Signed-off-by: Stefan Stanacar <stefanx.stanacar at intel.com>
> ---
>  lib/python2.7/site-packages/autobuilder/buildsteps/CheckOutLayers.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/CheckOutLayers.py b/lib/python2.7/site-packages/autobuilder/buildsteps/CheckOutLayers.py
> index f7b7d6e..46f9b25 100644
> --- a/lib/python2.7/site-packages/autobuilder/buildsteps/CheckOutLayers.py
> +++ b/lib/python2.7/site-packages/autobuilder/buildsteps/CheckOutLayers.py
> @@ -128,7 +128,7 @@ class CheckOutLayers(Git):
>
>      @defer.inlineCallbacks
>      def parseGotRevision(self, _=None):
> -        stdout = yield self._dovccmd(['rev-parse', self.commit], collectStdout=True)
> +        stdout = yield self._dovccmd(['rev-parse', self.commit + "^0"], collectStdout=True)
>          revision = stdout.strip()
>          if len(revision) != 40:
>              raise buildstep.BuildStepFailed()
> --
> 1.8.3.1
>



-- 
Elizabeth Flanagan
Yocto Project
Build and Release



More information about the yocto mailing list