From 7d9f8f6afd9a9ccb1360bc9e232a59ef3544e302 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 19 Nov 2009 18:44:15 +0100 Subject: [PATCH] lib/bb/fetch/git.py: add .git/last_commit_info and .git/branch to tarball .. this is can be used to create a version.h or anything other --- lib/bb/fetch/git.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/bb/fetch/git.py b/lib/bb/fetch/git.py index b25fd4c..cb97dfc 100644 --- a/lib/bb/fetch/git.py +++ b/lib/bb/fetch/git.py @@ -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") -- 2.7.4