All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Yu Ke <ke.yu@intel.com>
Cc: poky@yoctoproject.org
Subject: Re: [PATCH 10/11] bb.fetch2: add git unpack
Date: Tue, 25 Jan 2011 18:07:13 +0000	[thread overview]
Message-ID: <1295978833.14388.50360.camel@rex> (raw)
In-Reply-To: <8dfcbdd661ed90787b9680ea1bcdae45c4372a67.1295371995.git.ke.yu@intel.com>

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@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
 




  reply	other threads:[~2011-01-25 18:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-18 17:48 [PATCH 00/11] [RFC] fetch overhaul - API reorg and git optimization Yu Ke
2011-01-18 17:48 ` [PATCH 01/11] bitbake/fetch2/git: Add backwards compatibility code for branch name handling Yu Ke
2011-01-18 17:48 ` [PATCH 02/11] bb.fetch2: add unpack method in fetcher Yu Ke
2011-01-18 17:48 ` [PATCH 03/11] bb.fetch2: revise the Fetch.unpack API Yu Ke
2011-01-18 17:48 ` [PATCH 04/11] bb.fetch: add fetch version to distinguish bb.fetch and bb.fetch2 Yu Ke
2011-01-18 17:48 ` [PATCH 05/11] base.bbclass: use bb.fetch2 unpack API Yu Ke
2011-01-18 17:48 ` [PATCH 06/11] bb.fetch2: rename "go" with "download" to better reflect its functionality Yu Ke
2011-01-18 17:48 ` [PATCH 07/11] bbclasee: rename "go" with "download" Yu Ke
2011-01-18 17:48 ` [PATCH 08/11] bb.fetch2.git: split download to download() + build_mirror_data() Yu Ke
2011-01-18 17:48 ` [PATCH 09/11] bb.fetch2: remove the obsolate Fetch.try_mirrors referrence Yu Ke
2011-01-18 17:48 ` [PATCH 10/11] bb.fetch2: add git unpack Yu Ke
2011-01-25 18:07   ` Richard Purdie [this message]
2011-01-25 19:39     ` Bruce Ashfield
2011-01-26  4:41       ` Yu Ke
2011-01-26  4:43         ` Bruce Ashfield
2011-01-26  8:25           ` Yu Ke
2011-01-26 15:01             ` Bruce Ashfield
2011-01-18 17:48 ` [PATCH 11/11] git.py: remove the source tree tar ball Yu Ke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1295978833.14388.50360.camel@rex \
    --to=richard.purdie@linuxfoundation.org \
    --cc=ke.yu@intel.com \
    --cc=poky@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.