Skip to contentSkip to conversation

bitbake: fetch2/git: Anchor names when using ls-remote

PATCH In review Robert Yang 2 participants 4 messages Mar 26, 2014 – Mar 27, 2014

lore
Share & tools
lore
#0 lore raw

cover bitbake: fetch2/git: Anchor names when using ls-remote

The following changes since commit b9d99235585f9d62bb6937f5342606b5f5a4b58f:

image_types.bbclass: use 4096 instead of 8192 bytes-per-inode (2014-03-25 22:55:15 -0400)

are available in the git repository at:

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

Richard Purdie (1):
bitbake: fetch2/git: Anchor names when using ls-remote

 bitbake/lib/bb/fetch2/git.py |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 bitbake: fetch2/git: Anchor names when using ls-remote

From: Richard Purdie <[email protected]>

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)

Conflicts:
bitbake/lib/bb/fetch2/git.py
(ud.basecmd and basecmd conflicts, keep using basecmd)

---
 bitbake/lib/bb/fetch2/git.py |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
bitbake/lib/bb/fetch2/git.py +2 -2
index 6175e4c..cff5ce1 100644
@@ -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])
         if ud.proto.lower() != 'file':
             bb.fetch2.check_network_access(d, cmd)
         output = runfetchcmd(cmd, d, True)
Signature · 1 line
1.7.10.4
#2 lore raw
Quoted 30 lines · Robert Yang

From: Richard Purdie <[email protected]>

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)

Conflicts:
bitbake/lib/bb/fetch2/git.py
(ud.basecmd and basecmd conflicts, keep using basecmd)

---
 bitbake/lib/bb/fetch2/git.py |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
bitbake/lib/bb/fetch2/git.py +0 -0
index 6175e4c..cff5ce1 100644

bitbake/lib/bb/fetch2/git.py class Git(FetchMethod): · line 309

Quoted 7 lines
bitbake/lib/bb/fetch2/git.py +2 -2
@@ -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?

Cheers,

Richard

#3 lore raw
Quoted 33 lines · Richard Purdie
Quoted 32 lines · Robert Yang

From: Richard Purdie <[email protected]>

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)

Conflicts:
bitbake/lib/bb/fetch2/git.py
(ud.basecmd and basecmd conflicts, keep using basecmd)

---
  bitbake/lib/bb/fetch2/git.py |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
bitbake/lib/bb/fetch2/git.py +0 -0
index 6175e4c..cff5ce1 100644
@@ -305,8 +305,8 @@ class Git(FetchMethod):
              username = ""
 
Quoted 8 lines

bitbake/lib/bb/fetch2/git.py class Git(FetchMethod): · line 309

Quoted 5 lines
bitbake/lib/bb/fetch2/git.py +2 -2
          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

bitbake/lib/bb/fetch2/git.py +2 -2
index 6175e4c..989d72c 100644
@@ -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

Quoted 6 lines

Cheers,

Richard