* 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 | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/bb/fetch/git.py b/lib/bb/fetch/git.py index 5cdf656..b34208c 100644 --- a/lib/bb/fetch/git.py +++ b/lib/bb/fetch/git.py @@ -106,10 +106,18 @@ class Git(Fetch): if os.path.exists(codir): bb.utils.prunedir(codir) - bb.mkdirhier(codir) - os.chdir(repodir) - runfetchcmd("git read-tree %s" % (ud.tag), d) - runfetchcmd("git checkout-index -q -f --prefix=%s -a" % (os.path.join(codir, "git", "")), d) + coprefix = os.path.join(codir, "git", "") + + scmdata = ud.parm.get("scmdata", "") + if scmdata == "keep": + runfetchcmd("git clone -n %s %s" % (repodir, coprefix), d) + os.chdir(coprefix) + runfetchcmd("git checkout -q -f %s" % (ud.tag), d) + else: + bb.mkdirhier(codir) + os.chdir(repodir) + runfetchcmd("git read-tree %s" % (ud.tag), d) + runfetchcmd("git checkout-index -q -f --prefix=%s -a" % (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
