Openembedded Bitbake Development
 help / color / mirror / Atom feed
From: Robert Yang <liezhi.yang@windriver.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH 1/1] bitbake: fetch2/git: Anchor names when using ls-remote
Date: Thu, 27 Mar 2014 11:25:19 +0800	[thread overview]
Message-ID: <53339A1F.4050907@windriver.com> (raw)
In-Reply-To: <1395828299.24890.85.camel@ted>



On 03/26/2014 06:04 PM, Richard Purdie wrote:
> On Wed, 2014-03-26 at 05:27 -0400, Robert Yang wrote:
>> From: Richard Purdie <richard.purdie@linuxfoundation.org>
>>
>> When specifying tags, they're searched for unanchored so foo/bar could
>> match:
>>
>> refs/heads/abc/foo/bar
>> refs/heads/xyz/foo/bar
>> refs/heads/foo/bar
>>
>> This change anchors the expressions so they are based against heads
>> or tags (or any other base level tree that has been created).
>>
>> (Bitbake master rev: df2e0972cd1db7abd5ec8b7cb295fb0c42e284a4)
>>
>> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>>
>> Conflicts:
>> 	bitbake/lib/bb/fetch2/git.py
>> 	(ud.basecmd and basecmd conflicts, keep using basecmd)
>>
>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>> ---
>>   bitbake/lib/bb/fetch2/git.py |    4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
>> index 6175e4c..cff5ce1 100644
>> --- a/bitbake/lib/bb/fetch2/git.py
>> +++ b/bitbake/lib/bb/fetch2/git.py
>> @@ -305,8 +305,8 @@ class Git(FetchMethod):
>>               username = ""
>>
>>           basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
>> -        cmd = "%s ls-remote %s://%s%s%s %s" % \
>> -              (basecmd, ud.proto, username, ud.host, ud.path, ud.branches[name])
>> +        cmd = "%s ls-remote %s://%s%s%s refs/heads/%s refs/tags/%s" % \
>> +              (basecmd, ud.proto, username, ud.host, ud.path, ud.unresolvedrev[name], ud.unresolvedrev[name])
>
> Shouldn't this be ud.branches[name] for dora?
>

OOPS, thanks, I've updated the patch:

git://git.pokylinux.org/poky-contrib robert/dora-next
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/dora-next

diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 6175e4c..989d72c 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -305,8 +305,8 @@ class Git(FetchMethod):
              username = ""

          basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
-        cmd = "%s ls-remote %s://%s%s%s %s" % \
-              (basecmd, ud.proto, username, ud.host, ud.path, ud.branches[name])
+        cmd = "%s ls-remote %s://%s%s%s refs/heads/%s refs/tags/%s" % \
+              (basecmd, ud.proto, username, ud.host, ud.path, 
ud.branches[name], ud.branches[name])
          if ud.proto.lower() != 'file':
              bb.fetch2.check_network_access(d, cmd)
          output = runfetchcmd(cmd, d, True)

// Robert


> Cheers,
>
> Richard
>
>
>


      reply	other threads:[~2014-03-27  3:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-26  9:27 [dora] [PATCH 0/1] bitbake: fetch2/git: Anchor names when using ls-remote Robert Yang
2014-03-26  9:27 ` [PATCH 1/1] " Robert Yang
2014-03-26 10:04   ` Richard Purdie
2014-03-27  3:25     ` Robert Yang [this message]

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=53339A1F.4050907@windriver.com \
    --to=liezhi.yang@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