Skip to contentSkip to conversation

fetch2/git.py:_latest_revision: respect BB_FETCH_PREMIRRORONLY

PATCH In review Robert Yang 2 participants 4 messages Jan 7, 2016 – Jan 8, 2016

lore
Share & tools
lore
#0 lore raw

cover fetch2/git.py:_latest_revision: respect BB_FETCH_PREMIRRORONLY

The following changes since commit f8185ff9f8ac697733b41f023cb3a4b98b2f823f:

bitbake: ast: Add filename/lineno to mapped functions (2016-01-06 15:27:35 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib rbt/fetcher
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=rbt/fetcher

Robert Yang (1):
fetch2/git.py:_latest_revision: respect BB_FETCH_PREMIRRORONLY

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

PATCH 1/1 fetch2/git.py:_latest_revision: respect BB_FETCH_PREMIRRORONLY

Fixed when use a local BB_FETCH_PREMIRRORONLY for AUTOREV recipes:
SRCREV = "${AUTOREV}"
BB_NO_NETWORK = "1"
For example, the refpolicy-mls from meta-selinux:

$ bitbake refpolicy-mls -ccleanall/fetch

Log data follows:

| DEBUG: Executing python function do_cleanall
| DEBUG: Python function do_cleanall finished
| ERROR: Function failed: Network access disabled through BB_NO_NETWORK (or set indirectly due to use of BB_FETCH_PREMIRRORONLY) but access requested with command git -c core.fsyncobjectfiles=0 ls-remote git://github.com/TresysTechnology/refpolicy.git  (for url None)

ERROR: Task 3 (/path/to/meta-selinux/recipes-security/refpolicy/refpolicy-mls_git.bb, do_cleanall) failed with exit code '1'
NOTE: Tasks Summary: Attempted 4 tasks of which 0 didn't need to be rerun and 1 failed.

Check BB_FETCH_PREMIRRORONLY before ls-remote will fix the problem.

[YOCTO #8893]

---
 bitbake/lib/bb/fetch2/git.py |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
bitbake/lib/bb/fetch2/git.py +4 -1
index 5ffab22..7f7296f 100644
@@ -356,7 +356,10 @@ class Git(FetchMethod):
         """
         Compute the HEAD revision for the url
         """
-        output = self._lsremote(ud, d, "")
+        if d.getVar("BB_FETCH_PREMIRRORONLY", True) and ud.proto != "file":
+            return "HEAD"
+        else:
+            output = self._lsremote(ud, d, "")
         # Tags of the form ^{} may not work, need to fallback to other form
         if ud.unresolvedrev[name][:5] == "refs/":
             head = ud.unresolvedrev[name]
Signature · 1 line
1.7.9.5
#2 lore raw
Quoted 5 lines · Robert Yang

Fixed when use a local BB_FETCH_PREMIRRORONLY for AUTOREV recipes:
SRCREV = "${AUTOREV}"
BB_NO_NETWORK = "1"
For example, the refpolicy-mls from meta-selinux:

$ bitbake refpolicy-mls -ccleanall/fetch

This test case is incorrect, you shouldn't set BB_NO_NETWORK if you want to BB_FETCH_PREMIRRORONLY...

Cheers,

Richard

#3 lore raw
Quoted 10 lines · Richard Purdie
Quoted 5 lines · Robert Yang

Fixed when use a local BB_FETCH_PREMIRRORONLY for AUTOREV recipes:
SRCREV = "${AUTOREV}"
BB_NO_NETWORK = "1"
For example, the refpolicy-mls from meta-selinux:

$ bitbake refpolicy-mls -ccleanall/fetch

This test case is incorrect, you shouldn't set BB_NO_NETWORK if you want to BB_FETCH_PREMIRRORONLY...

Sorry, I'm a little confused about this, the PREMIRROR can be on local disk, so I think that we can set both BB_NO_NETWORK and BB_FETCH_PREMIRRORONLY ?

The commit message isn't correct enough, it should be:
"Fixed when use a local PREMIRROR for AUTOREV recipes"

// Robert

Quoted 5 lines

Cheers,

Richard