Add checkstatus command to the git fetcher
cover Add checkstatus command to the git fetcher
I'd like to use the fetcher's checkstatus method in the network sanity check of OpenEmbedded Core, to that end I've implemented the checkstatus method for the git fetcher using the ls-remote sub-command of git.
The following changes since commit 692c2fcead5c82249359ad54d2c7941d087a2eb3:
usermanual: The git fetcher defaults to the git protocol (or file) (2011-08-23 09:59:50 -0700)
are available in the git repository at:
git://github.com/incandescant/bitbake fetch
https://github.com/incandescant/bitbake/tree/fetch
Joshua Lock (1):
bb/fetch2/git: add checkstatus command
lib/bb/fetch2/git.py | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
Signature · 1 line
1.7.6
PATCH 1/1 bb/fetch2/git: add checkstatus command
Use git ls-remote to implement checkstatus command for the git fetcher.
--- lib/bb/fetch2/git.py | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
lib/bb/fetch2/git.py +8 -0
@@ -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
Signature · 1 line
1.7.6
Richard Purdie
AppliedRe: [PATCH 1/1] bb/fetch2/git: add checkstatus command
Quoted 13 lines · Joshua Lock
Use git ls-remote to implement checkstatus command for the git fetcher.
Signed-off-by Joshua Lock <[email protected]>--- lib/bb/fetch2/git.py | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)lib/bb/fetch2/git.py +0
-0@@ -298,3 +298,11 @@ class Git(FetchMethod): buildindex = "%s" % output.split()[0]
lib/bb/fetch2/git.py class Git(FetchMethod): · line 308
Quoted 10 lines
lib/bb/fetch2/git.py +8
-0logger.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
Merged to master, thanks.
Richard