summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch/git.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch/git.py')
-rw-r--r--bitbake/lib/bb/fetch/git.py17
1 files changed, 10 insertions, 7 deletions
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):
50 if 'protocol' in ud.parm: 50 if 'protocol' in ud.parm:
51 ud.proto = ud.parm['protocol'] 51 ud.proto = ud.parm['protocol']
52 52
53 tag = data.getVar("SRCREV", d, 0) 53 tag = data.getVar("SRCREV", d, 1)
54 if 'tag' in ud.parm: 54 if 'tag' in ud.parm:
55 ud.tag = ud.parm['tag'] 55 ud.tag = ud.parm['tag']
56 elif tag and "get_srcrev" not in tag and len(tag) == 40: 56 elif tag is "SRCREVINACTION":
57 ud.tag = tag 57 ud.tag = self.latest_revision(url, ud, d)
58 else: 58 else:
59 ud.tag = tag
60
61 if ud.tag == "master":
59 ud.tag = self.latest_revision(url, ud, d) 62 ud.tag = self.latest_revision(url, ud, d)
60 63
61 ud.localfile = data.expand('git_%s%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.tag), d) 64 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):
93 runfetchcmd("git pull --tags %s://%s%s" % (ud.proto, ud.host, ud.path), d) 96 runfetchcmd("git pull --tags %s://%s%s" % (ud.proto, ud.host, ud.path), d)
94 runfetchcmd("git prune-packed", d) 97 runfetchcmd("git prune-packed", d)
95 runfetchcmd("git pack-redundant --all | xargs -r rm", d) 98 runfetchcmd("git pack-redundant --all | xargs -r rm", d)
96 # old method of downloading tags
97 #runfetchcmd("rsync -a --verbose --stats --progress rsync://%s%s/ %s" % (ud.host, ud.path, os.path.join(repodir, ".git", "")), d)
98 99
99 os.chdir(repodir) 100 os.chdir(repodir)
100 bb.msg.note(1, bb.msg.domain.Fetcher, "Creating tarball of git repository") 101 mirror_tarballs = data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True)
101 runfetchcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ), d) 102 if mirror_tarballs != "0":
103 bb.msg.note(1, bb.msg.domain.Fetcher, "Creating tarball of git repository")
104 runfetchcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ), d)
102 105
103 if os.path.exists(codir): 106 if os.path.exists(codir):
104 prunedir(codir) 107 prunedir(codir)