Openembedded Bitbake Development
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH 4/4] fetch2/git.py: Optimize clone fall back when it is local
Date: Thu, 14 Jun 2012 08:33:17 -0500	[thread overview]
Message-ID: <4FD9E81D.6030808@windriver.com> (raw)
In-Reply-To: <1339679039.24333.76.camel@ted>

[-- Attachment #1: Type: text/plain, Size: 1509 bytes --]

On 06/14/2012 08:03 AM, Richard Purdie wrote:
> On Wed, 2012-06-13 at 22:09 -0500, Jason Wessel wrote:
>> A file:// url should use "clone -s" to greatly speed
>> up the clone in the case of a kernel when it is local.
>>
>> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
>> ---
>>  lib/bb/fetch2/git.py |    8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
>> index 1ad9213..f5a3983 100644
>> --- a/lib/bb/fetch2/git.py
>> +++ b/lib/bb/fetch2/git.py
>> @@ -192,7 +192,13 @@ class Git(FetchMethod):
>>  
>>          # If the repo still doesn't exist, fallback to cloning it
>>          if not os.path.exists(ud.clonedir):
>> -            clone_cmd = "%s clone --bare --mirror %s %s" % (ud.basecmd, repourl, ud.clonedir)
>> +            if repourl.startswith("file://"):
>> +                use_s = "-s"
>> +                repo = repourl[7:]
>> +            else:
>> +                use_s = ""
>> +                repo = repourl
>> +            clone_cmd = "%s clone %s --bare --mirror %s %s" % (ud.basecmd, use_s, repo, ud.clonedir)
>>              if ud.proto.lower() != 'file':
>>                  bb.fetch2.check_network_access(d, clone_cmd)
>>              runfetchcmd(clone_cmd, d)
> 
> How about always using the -l option instead?
> 

I just had to put it through some testing first.  Yes I agree it is fine to use -l as well.

Attached is the new version of the patch.

Jason.

[-- Attachment #2: 0001-fetch2-git.py-Optimize-clone-fall-back-when-it-is-lo.patch --]
[-- Type: text/x-diff, Size: 1370 bytes --]

From daa5cc78b294406fd2376697d44c4de1a42d6f34 Mon Sep 17 00:00:00 2001
From: Jason Wessel <jason.wessel@windriver.com>
Date: Tue, 12 Jun 2012 13:23:34 -0500
Subject: [PATCH] fetch2/git.py: Optimize clone fall back when it is local

A file:// url should use "clone -l" to greatly speed
up the clone in the case of a kernel when it is local.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 lib/bb/fetch2/git.py |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index ecc5e0d..d6a08ac 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -188,7 +188,13 @@ class Git(FetchMethod):
 
         # If the repo still doesn't exist, fallback to cloning it
         if not os.path.exists(ud.clonedir):
-            clone_cmd = "%s clone --bare --mirror %s %s" % (ud.basecmd, repourl, ud.clonedir)
+            if repourl.startswith("file://"):
+                use_s = "-l"
+                repo = repourl[7:]
+            else:
+                use_s = ""
+                repo = repourl
+            clone_cmd = "%s clone %s --bare --mirror %s %s" % (ud.basecmd, use_s, repo, ud.clonedir)
             if ud.proto.lower() != 'file':
                 bb.fetch2.check_network_access(d, clone_cmd)
             runfetchcmd(clone_cmd, d)
-- 
1.7.10


  reply	other threads:[~2012-06-14 13:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14  3:09 [PATCH 0/4] fetch2: fixes and optimizations Jason Wessel
2012-06-14  3:09 ` [PATCH 1/4] fetch2: Fix missing output from stderr in fetcher logs Jason Wessel
2012-06-14  3:09 ` [PATCH 2/4] fetch2: Fix URI encode / decode regression Jason Wessel
2012-06-14  3:09 ` [PATCH 3/4] fetch2: Allow local git trees as pre-mirrors Jason Wessel
2012-06-14  3:09 ` [PATCH 4/4] fetch2/git.py: Optimize clone fall back when it is local Jason Wessel
2012-06-14 13:03   ` Richard Purdie
2012-06-14 13:33     ` Jason Wessel [this message]
2012-06-14 14:26       ` Richard Purdie
2012-06-14 14:31         ` Jason Wessel
2012-06-14 21:11         ` Jason Wessel
2012-06-14 13:05 ` [PATCH 0/4] fetch2: fixes and optimizations Richard Purdie

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=4FD9E81D.6030808@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox