* Allows generating version information from Git during build.
* Note that tar doesn't need to use --exclude '.git', because
  git checkout-index doesn't clone the repository.

Signed-off-by: Andreas Oberritter <[email protected]>
---
 lib/bb/fetch/git.py |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/lib/bb/fetch/git.py b/lib/bb/fetch/git.py
index 41ebc5b..8feb53c 100644
--- a/lib/bb/fetch/git.py
+++ b/lib/bb/fetch/git.py
@@ -141,10 +141,16 @@ class Git(Fetch):
             readpathspec = ""
             coprefix = os.path.join(codir, "git", "")
 
-        bb.mkdirhier(codir)
-        os.chdir(ud.clonedir)
-        runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.tag, readpathspec), 
d)
-        runfetchcmd("%s checkout-index -q -f --prefix=%s -a" % (ud.basecmd, 
coprefix), d)
+        scmdata = ud.parm.get("scmdata", "")
+        if scmdata == "keep":
+            runfetchcmd("%s clone -n %s %s" % (ud.basecmd, ud.clonedir, 
coprefix), d)
+            os.chdir(coprefix)
+            runfetchcmd("%s checkout -q -f %s%s" % (ud.basecmd, ud.tag, 
readpathspec), d)
+        else:
+            bb.mkdirhier(codir)
+            os.chdir(ud.clonedir)
+            runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.tag, 
readpathspec), d)
+            runfetchcmd("%s checkout-index -q -f --prefix=%s -a" % 
(ud.basecmd, coprefix), d)
 
         os.chdir(codir)
         bb.msg.note(1, bb.msg.domain.Fetcher, "Creating tarball of git 
checkout")
-- 
1.7.2.3

_______________________________________________
Bitbake-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bitbake-dev

Reply via email to