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

Stefan Stanacar stefanx.stanacar at intel.com
Thu Oct 10 06:18:02 PDT 2013


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




More information about the yocto mailing list