[poky] [PATCH 10/11] bb.fetch2: add git unpack

Yu Ke ke.yu at intel.com
Tue Jan 18 09:48:25 PST 2011


git download will clone git repo to local, and git unpack just do a clone with referrence to the original repo

Signed-off-by: Yu Ke <ke.yu at intel.com>
---
 bitbake/lib/bb/fetch2/git.py |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 438756a..bb62a87 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -193,6 +193,22 @@ class Git(Fetch):
         os.chdir(ud.clonedir)
         bb.utils.prunedir(codir)
 
+    def unpack(self, ud, destdir, d):
+        """ unpack the downloaded src to destdir"""
+        subdir = ud.parm.get("subpath", "")
+        if subdir != "":
+            readpathspec = ":%s" % (subdir)
+        else:
+            readpathspec = ""
+
+        # extract to ${WORKDIR}/git
+        destdir = destdir + "/git/"
+
+        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, destdir), d)
+        return 1
+
     def supports_srcrev(self):
         return True
 
-- 
1.7.0.4




More information about the poky mailing list