[bitbake-devel] [PATCH 1/1] bb/fetch2/git: add checkstatus command

Joshua Lock josh at linux.intel.com
Wed Aug 24 20:04:23 UTC 2011


Use git ls-remote to implement checkstatus command for the git fetcher.

Signed-off-by: Joshua Lock <josh at linux.intel.com>
---
 lib/bb/fetch2/git.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 25c2c51..97bf086 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -298,3 +298,11 @@ class Git(FetchMethod):
         buildindex = "%s" % output.split()[0]
         logger.debug(1, "GIT repository for %s in %s is returning %s revisions in rev-list before %s", url, ud.clonedir, buildindex, rev)
         return buildindex
+
+    def checkstatus(self, uri, ud, d):
+        fetchcmd = "%s ls-remote %s" % (ud.basecmd, uri)
+        try:
+            runfetchcmd(fetchcmd, d, quiet=True)
+            return True
+        except FetchError:
+            return False
-- 
1.7.6





More information about the bitbake-devel mailing list