lib/bb/fetch/git.py: add .git/last_commit_info and .git/branch to tarball .. this...
authorghost <andreas.monzner@multimedia-labs.de>
Thu, 19 Nov 2009 17:44:15 +0000 (18:44 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Thu, 19 Nov 2009 17:44:15 +0000 (18:44 +0100)
lib/bb/fetch/git.py

index b25fd4c..cb97dfc 100644 (file)
@@ -194,8 +194,12 @@ class Git(Fetch):
 
             bb.mkdirhier(codir)
             os.chdir(repodir)
+            copath = os.path.join(codir, "git", "")
             runfetchcmd("git read-tree %s" % (tag),d)
-            runfetchcmd("git checkout-index -q -f --prefix=%s -a" % (os.path.join(codir, "git", "")),d)
+            runfetchcmd("git checkout-index -q -f --prefix=%s -a" % (copath),d)
+            bb.mkdirhier(os.path.join(copath, ".git", ""))
+            runfetchcmd("git log %s --max-count=1 --date=iso -- > %s.git/last_commit_info" % (tag, copath),d)
+            runfetchcmd("echo %s > %s.git/branch" % (branch, copath),d)
 
             os.chdir(codir)
             bb.note("Creating tarball of git checkout")