All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Yang <liezhi.yang@windriver.com>
To: <bitbake-devel@lists.openembedded.org>
Subject: [PATCH 2/2] fetch2: Unify BB_FETCH_PREMIRRORONLY
Date: Wed, 20 Mar 2019 14:40:51 +0800	[thread overview]
Message-ID: <db5c32f158267831427a769f4db1a4f80125fd92.1553063929.git.liezhi.yang@windriver.com> (raw)
In-Reply-To: <cover.1553063929.git.liezhi.yang@windriver.com>

The fetch2/__init__.py checks whether "BB_FETCH_PREMIRRORONLY" == "1", but
fetch2/git.py and hg.py checks whether it is None, this makes it discontinuous,
and BB_FETCH_PREMIRRORONLY = "0" doens't work as expected in the later case,
so unify it to the previous one. (As BB_NO_NETWORK does).

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 bitbake/lib/bb/fetch2/git.py | 2 +-
 bitbake/lib/bb/fetch2/hg.py  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 1a8ebe3..e021f33 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -318,7 +318,7 @@ class Git(FetchMethod):
     def try_premirror(self, ud, d):
         # If we don't do this, updating an existing checkout with only premirrors
         # is not possible
-        if d.getVar("BB_FETCH_PREMIRRORONLY") is not None:
+        if d.getVar("BB_FETCH_PREMIRRORONLY") == "1":
             return True
         if os.path.exists(ud.clonedir):
             return False
diff --git a/bitbake/lib/bb/fetch2/hg.py b/bitbake/lib/bb/fetch2/hg.py
index 936d043..5a3db92 100644
--- a/bitbake/lib/bb/fetch2/hg.py
+++ b/bitbake/lib/bb/fetch2/hg.py
@@ -99,7 +99,7 @@ class Hg(FetchMethod):
     def try_premirror(self, ud, d):
         # If we don't do this, updating an existing checkout with only premirrors
         # is not possible
-        if d.getVar("BB_FETCH_PREMIRRORONLY") is not None:
+        if d.getVar("BB_FETCH_PREMIRRORONLY") == "1":
             return True
         if os.path.exists(ud.moddir):
             return False
-- 
2.7.4



  parent reply	other threads:[~2019-03-20  6:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20  6:40 [PATCH 0/2] fetch2: Unify BB_FETCH_PREMIRRORONLY Robert Yang
2019-03-20  6:40 ` [PATCH 1/2] fetch2: runfetchcmd(): Print workdir in debug message Robert Yang
2019-03-20  6:40 ` Robert Yang [this message]
2019-03-21 23:35   ` [PATCH 2/2] fetch2: Unify BB_FETCH_PREMIRRORONLY Richard Purdie
2019-03-22  3:47     ` Robert Yang
2019-03-22 11:18       ` richard.purdie
2019-03-25  7:45         ` Robert Yang

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=db5c32f158267831427a769f4db1a4f80125fd92.1553063929.git.liezhi.yang@windriver.com \
    --to=liezhi.yang@windriver.com \
    --cc=bitbake-devel@lists.openembedded.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.