[poky] [PATCH 10/11] bb.fetch2: add git unpack
Richard Purdie
richard.purdie at linuxfoundation.org
Tue Jan 25 10:07:13 PST 2011
Hi Ke,
On Wed, 2011-01-19 at 01:48 +0800, Yu Ke wrote:
> 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
I know we talked about this via email and you revised the description
to:
http://git.pokylinux.org/cgit/cgit.cgi/poky-contrib/commit/?h=kyu3/fetcher-api-v3&id=6df3037ea3679b804c2679afba8377b7e3796aca
I'm wondering if we could optimise this cp command to be a "git clone
-l" or a "git clone -s" (see man git-clone). I'm cc'ing Bruce for his
thoughts on this and whether the linux-yocto tools would have a problem
with either of these.
The idea would be one central checkout with the references in and then
the subcomponents would all just reference the one local clone saving
diskspace and time.
Cheers,
Richard
More information about the poky
mailing list