From e9b7bc6914c0f1d9282f92748eaa3d308f5d03fd Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 7 Nov 2007 23:49:55 +0000 Subject: bitbake: fetcher updates - Add BB_GENERATE_MIRROR_TARBALLS option to allow disabling tarball creation to speedup git fetches, improve srcrev handling to remove some hacks and remove the need for external workarounds git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3101 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- bitbake/lib/bb/fetch/git.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'bitbake/lib/bb/fetch/git.py') diff --git a/bitbake/lib/bb/fetch/git.py b/bitbake/lib/bb/fetch/git.py index 7d55ee9138..c26ee3fff3 100644 --- a/bitbake/lib/bb/fetch/git.py +++ b/bitbake/lib/bb/fetch/git.py @@ -50,12 +50,15 @@ class Git(Fetch): if 'protocol' in ud.parm: ud.proto = ud.parm['protocol'] - tag = data.getVar("SRCREV", d, 0) + tag = data.getVar("SRCREV", d, 1) if 'tag' in ud.parm: ud.tag = ud.parm['tag'] - elif tag and "get_srcrev" not in tag and len(tag) == 40: - ud.tag = tag + elif tag is "SRCREVINACTION": + ud.tag = self.latest_revision(url, ud, d) else: + ud.tag = tag + + if ud.tag == "master": ud.tag = self.latest_revision(url, ud, d) ud.localfile = data.expand('git_%s%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.tag), d) @@ -93,12 +96,12 @@ class Git(Fetch): runfetchcmd("git pull --tags %s://%s%s" % (ud.proto, ud.host, ud.path), d) runfetchcmd("git prune-packed", d) runfetchcmd("git pack-redundant --all | xargs -r rm", d) - # old method of downloading tags - #runfetchcmd("rsync -a --verbose --stats --progress rsync://%s%s/ %s" % (ud.host, ud.path, os.path.join(repodir, ".git", "")), d) os.chdir(repodir) - bb.msg.note(1, bb.msg.domain.Fetcher, "Creating tarball of git repository") - runfetchcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ), d) + mirror_tarballs = data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True) + if mirror_tarballs != "0": + bb.msg.note(1, bb.msg.domain.Fetcher, "Creating tarball of git repository") + runfetchcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ), d) if os.path.exists(codir): prunedir(codir) -- cgit v1.2.3