summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/fetch2/git.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index ba8126f003..a4a1278b68 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -66,7 +66,7 @@ class Git(Fetch):
66 ud.branches[name] = branch 66 ud.branches[name] = branch
67 67
68 gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.')) 68 gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.'))
69 ud.mirrortarball = 'git_%s.tar.gz' % (gitsrcname) 69 ud.mirrortarball = 'git2_%s.tar.gz' % (gitsrcname)
70 ud.clonedir = os.path.join(data.expand('${GITDIR}', d), gitsrcname) 70 ud.clonedir = os.path.join(data.expand('${GITDIR}', d), gitsrcname)
71 71
72 ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git" 72 ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
@@ -116,8 +116,8 @@ class Git(Fetch):
116 116
117 # If the repo still doesn't exist, fallback to cloning it 117 # If the repo still doesn't exist, fallback to cloning it
118 if not os.path.exists(ud.clonedir): 118 if not os.path.exists(ud.clonedir):
119 bb.fetch2.check_network_access(d, "git clone %s%s" % (ud.host, ud.path)) 119 bb.fetch2.check_network_access(d, "git clone --bare %s%s" % (ud.host, ud.path))
120 runfetchcmd("%s clone -n %s://%s%s%s %s" % (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.clonedir), d) 120 runfetchcmd("%s clone --bare %s://%s%s%s %s" % (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.clonedir), d)
121 121
122 os.chdir(ud.clonedir) 122 os.chdir(ud.clonedir)
123 # Update the checkout if needed 123 # Update the checkout if needed
@@ -147,7 +147,7 @@ class Git(Fetch):
147 mirror_tarballs = data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True) 147 mirror_tarballs = data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True)
148 if mirror_tarballs != "0" and ud.repochanged: 148 if mirror_tarballs != "0" and ud.repochanged:
149 logger.info("Creating tarball of git repository") 149 logger.info("Creating tarball of git repository")
150 runfetchcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ), d) 150 runfetchcmd("tar -czf %s %s" % (repofile, os.path.join(".") ), d)
151 151
152 def unpack(self, ud, destdir, d): 152 def unpack(self, ud, destdir, d):
153 """ unpack the downloaded src to destdir""" 153 """ unpack the downloaded src to destdir"""
@@ -163,11 +163,6 @@ class Git(Fetch):
163 bb.utils.prunedir(destdir) 163 bb.utils.prunedir(destdir)
164 164
165 runfetchcmd("git clone -s -n %s %s" % (ud.clonedir, destdir), d) 165 runfetchcmd("git clone -s -n %s %s" % (ud.clonedir, destdir), d)
166 if os.path.exists("%s/.git/refs/remotes/origin" % ud.clonedir):
167 bb.mkdirhier("%s/.git/refs/remotes/origin/" % destdir)
168 runfetchcmd("cp -af %s/.git/refs/remotes/origin/* %s/.git/refs/remotes/origin/" %(ud.clonedir, destdir), d)
169 if os.path.exists("%s/.git/packed-refs" % ud.clonedir):
170 runfetchcmd("cp -af %s/.git/packed-refs %s/.git/" %(ud.clonedir, destdir), d)
171 if not ud.nocheckout: 166 if not ud.nocheckout:
172 os.chdir(destdir) 167 os.chdir(destdir)
173 runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.revisions[ud.names[0]], readpathspec), d) 168 runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.revisions[ud.names[0]], readpathspec), d)