summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch/git.py
diff options
context:
space:
mode:
authorAndreas Oberritter <obi@opendreambox.org>2010-12-08 13:38:23 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2011-01-04 14:46:51 +0000
commitbd34e7d6dffbdcd3cfb0bc21daf73e9090e5110f (patch)
tree4eb6fdd4501facd55b4921f7b09f35bac638b79f /bitbake/lib/bb/fetch/git.py
parent7bbde5b149751c2b38964b786b76a25f62199397 (diff)
downloadpoky-bd34e7d6dffbdcd3cfb0bc21daf73e9090e5110f.tar.gz
fetchers: Add parameter scmdata=keep to include .git/ and others in generated tarballs.
* Allows generating version information from SCMs during build. * Note that tar doesn't need to use --exclude '.git', because git checkout-index doesn't clone the repository. (Bitbake rev: 05cbc1d1a01c667c77688f36fbc5b61c5f452a3a) Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/fetch/git.py')
-rw-r--r--bitbake/lib/bb/fetch/git.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/bitbake/lib/bb/fetch/git.py b/bitbake/lib/bb/fetch/git.py
index a2fbd78cbf..de415ec309 100644
--- a/bitbake/lib/bb/fetch/git.py
+++ b/bitbake/lib/bb/fetch/git.py
@@ -180,14 +180,20 @@ class Git(Fetch):
180 readpathspec = "" 180 readpathspec = ""
181 coprefix = os.path.join(codir, "git", "") 181 coprefix = os.path.join(codir, "git", "")
182 182
183 bb.mkdirhier(codir) 183 scmdata = ud.parm.get("scmdata", "")
184 os.chdir(ud.clonedir) 184 if scmdata == "keep":
185 runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.tag, readpathspec), d) 185 runfetchcmd("%s clone -n %s %s" % (ud.basecmd, ud.clonedir, coprefix), d)
186 runfetchcmd("%s checkout-index -q -f --prefix=%s -a" % (ud.basecmd, coprefix), d) 186 os.chdir(coprefix)
187 runfetchcmd("%s checkout -q -f %s%s" % (ud.basecmd, ud.tag, readpathspec), d)
188 else:
189 bb.mkdirhier(codir)
190 os.chdir(ud.clonedir)
191 runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.tag, readpathspec), d)
192 runfetchcmd("%s checkout-index -q -f --prefix=%s -a" % (ud.basecmd, coprefix), d)
187 193
188 os.chdir(codir) 194 os.chdir(codir)
189 logger.info("Creating tarball of git checkout") 195 logger.info("Creating tarball of git checkout")
190 runfetchcmd("tar --exclude '.git' -czf %s %s" % (ud.localpath, os.path.join(".", "*") ), d) 196 runfetchcmd("tar -czf %s %s" % (ud.localpath, os.path.join(".", "*") ), d)
191 197
192 os.chdir(ud.clonedir) 198 os.chdir(ud.clonedir)
193 bb.utils.prunedir(codir) 199 bb.utils.prunedir(codir)