summaryrefslogtreecommitdiff
path: root/bitbake/lib
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2010-08-27 14:06:18 +0100
committerJoshua Lock <josh@linux.intel.com>2010-09-01 11:14:41 +0100
commit5c229f921fbd6f1ffae4038c05bf32f9b4051684 (patch)
tree47ca42c4cab5b734f877d3a37dac9959f20e3298 /bitbake/lib
parentb54e95fd069217a192d9bb8a3c261e33600e2538 (diff)
downloadopenembedded-core-5c229f921fbd6f1ffae4038c05bf32f9b4051684.tar.gz
openembedded-core-5c229f921fbd6f1ffae4038c05bf32f9b4051684.tar.bz2
openembedded-core-5c229f921fbd6f1ffae4038c05bf32f9b4051684.tar.xz
openembedded-core-5c229f921fbd6f1ffae4038c05bf32f9b4051684.zip
bitbake/git: define a forcefetch method
The git fetcher should force a fetch if the required tag is not present in the local clone, or if the fullclone parameter is set. Signed-off-by: Joshua Lock <josh@linux.intel.com>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/fetch/git.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch/git.py b/bitbake/lib/bb/fetch/git.py
index 9cd538854..b6126cbe9 100644
--- a/bitbake/lib/bb/fetch/git.py
+++ b/bitbake/lib/bb/fetch/git.py
@@ -85,6 +85,11 @@ class Git(Fetch):
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
+ def forcefetch(self, url, ud, d):
+ if not self._contains_ref(ud.tag, d) or 'fullclone' in ud.parm:
+ return True
+ return False
+
def go(self, loc, ud, d):
"""Fetch url"""
@@ -108,8 +113,8 @@ class Git(Fetch):
runfetchcmd("%s clone -n %s://%s%s%s %s" % (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.clonedir), d)
os.chdir(ud.clonedir)
- # Remove all but the .git directory
if not self._contains_ref(ud.tag, d) or 'fullclone' in ud.parm:
+ # Remove all but the .git directory
runfetchcmd("rm * -Rf", d)
runfetchcmd("%s fetch %s://%s%s%s %s" % (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.branch), d)
runfetchcmd("%s fetch --tags %s://%s%s%s" % (ud.basecmd, ud.proto, username, ud.host, ud.path), d)