* [master][PATCH] bitbake: remove True option to getVar calls
@ 2019-01-13 11:18 André Draszik
2019-02-11 12:15 ` André Draszik
0 siblings, 1 reply; 2+ messages in thread
From: André Draszik @ 2019-01-13 11:18 UTC (permalink / raw)
To: bitbake-devel
From: André Draszik <andre.draszik@jci.com>
getVar() has been defaulting to expanding by default for
a long time (2016), thus remove the True option from
getVar() calls with a regex search and replace.
Search & replace made using the following command:
sed -e 's|\(d\.getVar \?\)( \?\([^,()]*\), \?True)|\1(\2)|g' \
-i $(git grep -E 'getVar ?\( ?([^,()]*), ?True\)' \
| cut -d':' -f1 \
| sort -u)
Signed-off-by: André Draszik <andre.draszik@jci.com>
---
classes/base.bbclass | 2 +-
lib/bb/fetch2/git.py | 2 +-
lib/bb/tests/fetch.py | 8 ++++----
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/classes/base.bbclass b/classes/base.bbclass
index 71d9ec16..08441fe1 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -44,7 +44,7 @@ python do_showdata() {
# emit the metadata which isnt valid shell
for e in bb.data.keys(d):
if d.getVarFlag(e, 'python', False):
- bb.plain("\npython %s () {\n%s}" % (e, d.getVar(e, True)))
+ bb.plain("\npython %s () {\n%s}" % (e, d.getVar(e)))
}
addtask listtasks
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 59a2ee8f..8ab4b7e1 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -199,7 +199,7 @@ class Git(FetchMethod):
depth_default = 1
ud.shallow_depths = collections.defaultdict(lambda: depth_default)
- revs_default = d.getVar("BB_GIT_SHALLOW_REVS", True)
+ revs_default = d.getVar("BB_GIT_SHALLOW_REVS")
ud.shallow_revs = []
ud.branches = {}
for pos, name in enumerate(ud.names):
diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index 6848095c..7b5d9684 100644
--- a/lib/bb/tests/fetch.py
+++ b/lib/bb/tests/fetch.py
@@ -1280,7 +1280,7 @@ class GitShallowTest(FetcherTest):
def fetch(self, uri=None):
if uri is None:
- uris = self.d.getVar('SRC_URI', True).split()
+ uris = self.d.getVar('SRC_URI').split()
uri = uris[0]
d = self.d
else:
@@ -1338,7 +1338,7 @@ class GitShallowTest(FetcherTest):
srcrev = self.git('rev-parse HEAD', cwd=self.srcdir).strip()
self.d.setVar('SRCREV', srcrev)
- uri = self.d.getVar('SRC_URI', True).split()[0]
+ uri = self.d.getVar('SRC_URI').split()[0]
uri = '%s;nobranch=1;bare=1' % uri
self.fetch_shallow(uri)
@@ -1510,7 +1510,7 @@ class GitShallowTest(FetcherTest):
self.add_empty_file('f')
self.assertRevCount(7, cwd=self.srcdir)
- uri = self.d.getVar('SRC_URI', True).split()[0]
+ uri = self.d.getVar('SRC_URI').split()[0]
uri = '%s;branch=master,a_branch;name=master,a_branch' % uri
self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
@@ -1536,7 +1536,7 @@ class GitShallowTest(FetcherTest):
self.add_empty_file('f')
self.assertRevCount(7, cwd=self.srcdir)
- uri = self.d.getVar('SRC_URI', True).split()[0]
+ uri = self.d.getVar('SRC_URI').split()[0]
uri = '%s;branch=master,a_branch;name=master,a_branch' % uri
self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [master][PATCH] bitbake: remove True option to getVar calls
2019-01-13 11:18 [master][PATCH] bitbake: remove True option to getVar calls André Draszik
@ 2019-02-11 12:15 ` André Draszik
0 siblings, 0 replies; 2+ messages in thread
From: André Draszik @ 2019-02-11 12:15 UTC (permalink / raw)
To: bitbake-devel
ping
On Sun, 2019-01-13 at 11:18 +0000, André Draszik wrote:
> From: André Draszik <andre.draszik@jci.com>
>
> getVar() has been defaulting to expanding by default for
> a long time (2016), thus remove the True option from
> getVar() calls with a regex search and replace.
>
> Search & replace made using the following command:
> sed -e 's|\(d\.getVar \?\)( \?\([^,()]*\), \?True)|\1(\2)|g' \
> -i $(git grep -E 'getVar ?\( ?([^,()]*), ?True\)' \
> | cut -d':' -f1 \
> | sort -u)
>
> Signed-off-by: André Draszik <andre.draszik@jci.com>
> ---
> classes/base.bbclass | 2 +-
> lib/bb/fetch2/git.py | 2 +-
> lib/bb/tests/fetch.py | 8 ++++----
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/classes/base.bbclass b/classes/base.bbclass
> index 71d9ec16..08441fe1 100644
> --- a/classes/base.bbclass
> +++ b/classes/base.bbclass
> @@ -44,7 +44,7 @@ python do_showdata() {
> # emit the metadata which isnt valid shell
> for e in bb.data.keys(d):
> if d.getVarFlag(e, 'python', False):
> - bb.plain("\npython %s () {\n%s}" % (e, d.getVar(e,
> True)))
> + bb.plain("\npython %s () {\n%s}" % (e, d.getVar(e)))
> }
>
> addtask listtasks
> diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
> index 59a2ee8f..8ab4b7e1 100644
> --- a/lib/bb/fetch2/git.py
> +++ b/lib/bb/fetch2/git.py
> @@ -199,7 +199,7 @@ class Git(FetchMethod):
> depth_default = 1
> ud.shallow_depths = collections.defaultdict(lambda:
> depth_default)
>
> - revs_default = d.getVar("BB_GIT_SHALLOW_REVS", True)
> + revs_default = d.getVar("BB_GIT_SHALLOW_REVS")
> ud.shallow_revs = []
> ud.branches = {}
> for pos, name in enumerate(ud.names):
> diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
> index 6848095c..7b5d9684 100644
> --- a/lib/bb/tests/fetch.py
> +++ b/lib/bb/tests/fetch.py
> @@ -1280,7 +1280,7 @@ class GitShallowTest(FetcherTest):
>
> def fetch(self, uri=None):
> if uri is None:
> - uris = self.d.getVar('SRC_URI', True).split()
> + uris = self.d.getVar('SRC_URI').split()
> uri = uris[0]
> d = self.d
> else:
> @@ -1338,7 +1338,7 @@ class GitShallowTest(FetcherTest):
>
> srcrev = self.git('rev-parse HEAD', cwd=self.srcdir).strip()
> self.d.setVar('SRCREV', srcrev)
> - uri = self.d.getVar('SRC_URI', True).split()[0]
> + uri = self.d.getVar('SRC_URI').split()[0]
> uri = '%s;nobranch=1;bare=1' % uri
>
> self.fetch_shallow(uri)
> @@ -1510,7 +1510,7 @@ class GitShallowTest(FetcherTest):
> self.add_empty_file('f')
> self.assertRevCount(7, cwd=self.srcdir)
>
> - uri = self.d.getVar('SRC_URI', True).split()[0]
> + uri = self.d.getVar('SRC_URI').split()[0]
> uri = '%s;branch=master,a_branch;name=master,a_branch' % uri
>
> self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
> @@ -1536,7 +1536,7 @@ class GitShallowTest(FetcherTest):
> self.add_empty_file('f')
> self.assertRevCount(7, cwd=self.srcdir)
>
> - uri = self.d.getVar('SRC_URI', True).split()[0]
> + uri = self.d.getVar('SRC_URI').split()[0]
> uri = '%s;branch=master,a_branch;name=master,a_branch' % uri
>
> self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-02-11 12:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-13 11:18 [master][PATCH] bitbake: remove True option to getVar calls André Draszik
2019-02-11 12:15 ` André Draszik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox