diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2008-12-06 12:12:52 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2008-12-06 12:12:52 +0000 |
commit | e990d01f34e1852f65450a5de1b8aa289bb2bc80 (patch) | |
tree | a8115ca31380f3f6b8e8c2c4a9df1acb446a5750 | |
parent | c704085a78b0601743aa6ef4b5d315da9ab534ee (diff) | |
download | bitbake-e990d01f34e1852f65450a5de1b8aa289bb2bc80.tar.gz |
git.py: Add username handling to the git fetcher (Robert Bragg from Poky)
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | lib/bb/fetch/git.py | 11 |
2 files changed, 9 insertions, 3 deletions
@@ -67,6 +67,7 @@ Changes in BitBake 1.8.x: to fulfil failed dependencies. It defaults to off, changing the default since this behaviour confuses many users and isn't often useful. - Improve lock file function error handling + - Add username handling to the git fetcher (Robert Bragg) Changes in BitBake 1.8.10: - Psyco is available only for x86 - do not use it on other architectures. diff --git a/lib/bb/fetch/git.py b/lib/bb/fetch/git.py index 3a2fa5ab7..f3d4fa4f0 100644 --- a/lib/bb/fetch/git.py +++ b/lib/bb/fetch/git.py @@ -66,6 +66,11 @@ class Git(Fetch): bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists (or was stashed). Skipping git checkout." % ud.localpath) return + if ud.user: + username = ud.user + '@' + else: + username = "" + gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.')) repofilename = 'git_%s.tar.gz' % (gitsrcname) @@ -81,14 +86,14 @@ class Git(Fetch): os.chdir(repodir) runfetchcmd("tar -xzf %s" % (repofile), d) else: - runfetchcmd("git clone -n %s://%s%s %s" % (ud.proto, ud.host, ud.path, repodir), d) + runfetchcmd("git clone -n %s://%s%s%s %s" % (ud.proto, username, ud.host, ud.path, repodir), d) os.chdir(repodir) # Remove all but the .git directory if not self._contains_ref(ud.tag, d): runfetchcmd("rm * -Rf", d) - runfetchcmd("git fetch %s://%s%s %s" % (ud.proto, ud.host, ud.path, ud.branch), d) - runfetchcmd("git fetch --tags %s://%s%s" % (ud.proto, ud.host, ud.path), d) + runfetchcmd("git fetch %s://%s%s%s %s" % (ud.proto, username, ud.host, ud.path, ud.branch), d) + runfetchcmd("git fetch --tags %s://%s%s%s" % (ud.proto, username, ud.host, ud.path), d) runfetchcmd("git prune-packed", d) runfetchcmd("git pack-redundant --all | xargs -r rm", d) |