summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch/git.py
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2010-02-01 16:56:16 +0000
committerJoshua Lock <josh@linux.intel.com>2010-02-04 00:18:29 +0000
commit0737552c1de18c64db8a5a52248a3e7b217f30aa (patch)
treed556e058c5e3b85dde0b3c13f5e9e25e472a5ed8 /bitbake/lib/bb/fetch/git.py
parent0b52537f5ce39a6025a2a8de381792accc333b8e (diff)
downloadpoky-0737552c1de18c64db8a5a52248a3e7b217f30aa.tar.gz
bitbake: unify mirror support and make it independant of the fetcher
This patch serves two purposes. Firstly it unifies the concept of mirrors into PREMIRRORS and MIRRORS. PREMIRRORS are tried before the SRC_URI defined in the recipe whereas MIRRORS are tried only if that fails. The tarball stash was conceptually inline with a PREMIRROR only with special handling within the wget fetcher and therefore only worked with certain fetch types. Secondly the patch removes the need for individual fetch implementations to worry about mirror handling. With this patch, the base fetch implementation will first try to use a PREMIRROR to fetch the desired object, if this fails the native fetch method for the object will be tried and if this fails will try to fetch a copy from one of the MIRRORS. Signed-off-by: Joshua Lock <josh@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/fetch/git.py')
-rw-r--r--bitbake/lib/bb/fetch/git.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch/git.py b/bitbake/lib/bb/fetch/git.py
index 9430582d55..10b396bb00 100644
--- a/bitbake/lib/bb/fetch/git.py
+++ b/bitbake/lib/bb/fetch/git.py
@@ -82,10 +82,6 @@ class Git(Fetch):
82 def go(self, loc, ud, d): 82 def go(self, loc, ud, d):
83 """Fetch url""" 83 """Fetch url"""
84 84
85 if Fetch.try_mirror(d, ud.localfile):
86 bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists (or was stashed). Skipping git checkout." % ud.localpath)
87 return
88
89 if ud.user: 85 if ud.user:
90 username = ud.user + '@' 86 username = ud.user + '@'
91 else: 87 else:
@@ -97,11 +93,12 @@ class Git(Fetch):
97 codir = os.path.join(ud.clonedir, coname) 93 codir = os.path.join(ud.clonedir, coname)
98 94
99 if not os.path.exists(ud.clonedir): 95 if not os.path.exists(ud.clonedir):
100 if Fetch.try_mirror(d, ud.mirrortarball): 96 try:
97 Fetch.try_mirrors(ud.mirrortarball)
101 bb.mkdirhier(ud.clonedir) 98 bb.mkdirhier(ud.clonedir)
102 os.chdir(ud.clonedir) 99 os.chdir(ud.clonedir)
103 runfetchcmd("tar -xzf %s" % (repofile), d) 100 runfetchcmd("tar -xzf %s" % (repofile), d)
104 else: 101 except:
105 runfetchcmd("git clone -n %s://%s%s%s %s" % (ud.proto, username, ud.host, ud.path, ud.clonedir), d) 102 runfetchcmd("git clone -n %s://%s%s%s %s" % (ud.proto, username, ud.host, ud.path, ud.clonedir), d)
106 103
107 os.chdir(ud.clonedir) 104 os.chdir(ud.clonedir)