summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py2
-rw-r--r--bitbake/lib/bb/fetch2/clearcase.py6
-rw-r--r--bitbake/lib/bb/fetch2/git.py4
-rw-r--r--bitbake/lib/bb/fetch2/hg.py2
-rw-r--r--bitbake/lib/bb/fetch2/local.py8
-rw-r--r--bitbake/lib/bb/fetch2/npm.py2
-rw-r--r--bitbake/lib/bb/fetch2/repo.py6
-rw-r--r--bitbake/lib/bb/fetch2/sftp.py4
-rw-r--r--bitbake/lib/bb/tests/codeparser.py14
9 files changed, 24 insertions, 24 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index cd7362c44a..5c76b22529 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -1282,7 +1282,7 @@ class FetchMethod(object):
1282 Can also setup variables in urldata for use in go (saving code duplication 1282 Can also setup variables in urldata for use in go (saving code duplication
1283 and duplicate code execution) 1283 and duplicate code execution)
1284 """ 1284 """
1285 return os.path.join(data.getVar("DL_DIR", d, True), urldata.localfile) 1285 return os.path.join(d.getVar("DL_DIR", True), urldata.localfile)
1286 1286
1287 def supports_checksum(self, urldata): 1287 def supports_checksum(self, urldata):
1288 """ 1288 """
diff --git a/bitbake/lib/bb/fetch2/clearcase.py b/bitbake/lib/bb/fetch2/clearcase.py
index 70e280a8dd..d35b2dabeb 100644
--- a/bitbake/lib/bb/fetch2/clearcase.py
+++ b/bitbake/lib/bb/fetch2/clearcase.py
@@ -110,7 +110,7 @@ class ClearCase(FetchMethod):
110 110
111 ud.basecmd = d.getVar("FETCHCMD_ccrc", True) or spawn.find_executable("cleartool") or spawn.find_executable("rcleartool") 111 ud.basecmd = d.getVar("FETCHCMD_ccrc", True) or spawn.find_executable("cleartool") or spawn.find_executable("rcleartool")
112 112
113 if data.getVar("SRCREV", d, True) == "INVALID": 113 if d.getVar("SRCREV", True) == "INVALID":
114 raise FetchError("Set a valid SRCREV for the clearcase fetcher in your recipe, e.g. SRCREV = \"/main/LATEST\" or any other label of your choice.") 114 raise FetchError("Set a valid SRCREV for the clearcase fetcher in your recipe, e.g. SRCREV = \"/main/LATEST\" or any other label of your choice.")
115 115
116 ud.label = d.getVar("SRCREV", False) 116 ud.label = d.getVar("SRCREV", False)
@@ -124,7 +124,7 @@ class ClearCase(FetchMethod):
124 124
125 ud.viewname = "%s-view%s" % (ud.identifier, d.getVar("DATETIME", d, True)) 125 ud.viewname = "%s-view%s" % (ud.identifier, d.getVar("DATETIME", d, True))
126 ud.csname = "%s-config-spec" % (ud.identifier) 126 ud.csname = "%s-config-spec" % (ud.identifier)
127 ud.ccasedir = os.path.join(data.getVar("DL_DIR", d, True), ud.type) 127 ud.ccasedir = os.path.join(d.getVar("DL_DIR", True), ud.type)
128 ud.viewdir = os.path.join(ud.ccasedir, ud.viewname) 128 ud.viewdir = os.path.join(ud.ccasedir, ud.viewname)
129 ud.configspecfile = os.path.join(ud.ccasedir, ud.csname) 129 ud.configspecfile = os.path.join(ud.ccasedir, ud.csname)
130 ud.localfile = "%s.tar.gz" % (ud.identifier) 130 ud.localfile = "%s.tar.gz" % (ud.identifier)
@@ -144,7 +144,7 @@ class ClearCase(FetchMethod):
144 self.debug("configspecfile = %s" % ud.configspecfile) 144 self.debug("configspecfile = %s" % ud.configspecfile)
145 self.debug("localfile = %s" % ud.localfile) 145 self.debug("localfile = %s" % ud.localfile)
146 146
147 ud.localfile = os.path.join(data.getVar("DL_DIR", d, True), ud.localfile) 147 ud.localfile = os.path.join(d.getVar("DL_DIR", True), ud.localfile)
148 148
149 def _build_ccase_command(self, ud, command): 149 def _build_ccase_command(self, ud, command):
150 """ 150 """
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 1bec60ab71..6b618345c3 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -182,9 +182,9 @@ class Git(FetchMethod):
182 if ud.usehead: 182 if ud.usehead:
183 ud.unresolvedrev['default'] = 'HEAD' 183 ud.unresolvedrev['default'] = 'HEAD'
184 184
185 ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git -c core.fsyncobjectfiles=0" 185 ud.basecmd = d.getVar("FETCHCMD_git", True) or "git -c core.fsyncobjectfiles=0"
186 186
187 ud.write_tarballs = ((data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True) or "0") != "0") or ud.rebaseable 187 ud.write_tarballs = ((d.getVar("BB_GENERATE_MIRROR_TARBALLS", True) or "0") != "0") or ud.rebaseable
188 188
189 ud.setup_revisons(d) 189 ud.setup_revisons(d)
190 190
diff --git a/bitbake/lib/bb/fetch2/hg.py b/bitbake/lib/bb/fetch2/hg.py
index 20df8016da..a1419aade5 100644
--- a/bitbake/lib/bb/fetch2/hg.py
+++ b/bitbake/lib/bb/fetch2/hg.py
@@ -84,7 +84,7 @@ class Hg(FetchMethod):
84 ud.pkgdir = os.path.join(hgdir, hgsrcname) 84 ud.pkgdir = os.path.join(hgdir, hgsrcname)
85 ud.moddir = os.path.join(ud.pkgdir, ud.module) 85 ud.moddir = os.path.join(ud.pkgdir, ud.module)
86 ud.localfile = ud.moddir 86 ud.localfile = ud.moddir
87 ud.basecmd = data.getVar("FETCHCMD_hg", d, True) or "/usr/bin/env hg" 87 ud.basecmd = d.getVar("FETCHCMD_hg", True) or "/usr/bin/env hg"
88 88
89 ud.write_tarballs = d.getVar("BB_GENERATE_MIRROR_TARBALLS", True) 89 ud.write_tarballs = d.getVar("BB_GENERATE_MIRROR_TARBALLS", True)
90 90
diff --git a/bitbake/lib/bb/fetch2/local.py b/bitbake/lib/bb/fetch2/local.py
index 51ca78d12b..5adfd5d448 100644
--- a/bitbake/lib/bb/fetch2/local.py
+++ b/bitbake/lib/bb/fetch2/local.py
@@ -63,13 +63,13 @@ class Local(FetchMethod):
63 newpath = path 63 newpath = path
64 if path[0] == "/": 64 if path[0] == "/":
65 return [path] 65 return [path]
66 filespath = data.getVar('FILESPATH', d, True) 66 filespath = d.getVar('FILESPATH', True)
67 if filespath: 67 if filespath:
68 logger.debug(2, "Searching for %s in paths:\n %s" % (path, "\n ".join(filespath.split(":")))) 68 logger.debug(2, "Searching for %s in paths:\n %s" % (path, "\n ".join(filespath.split(":"))))
69 newpath, hist = bb.utils.which(filespath, path, history=True) 69 newpath, hist = bb.utils.which(filespath, path, history=True)
70 searched.extend(hist) 70 searched.extend(hist)
71 if not newpath: 71 if not newpath:
72 filesdir = data.getVar('FILESDIR', d, True) 72 filesdir = d.getVar('FILESDIR', True)
73 if filesdir: 73 if filesdir:
74 logger.debug(2, "Searching for %s in path: %s" % (path, filesdir)) 74 logger.debug(2, "Searching for %s in path: %s" % (path, filesdir))
75 newpath = os.path.join(filesdir, path) 75 newpath = os.path.join(filesdir, path)
@@ -100,10 +100,10 @@ class Local(FetchMethod):
100 # no need to fetch local files, we'll deal with them in place. 100 # no need to fetch local files, we'll deal with them in place.
101 if self.supports_checksum(urldata) and not os.path.exists(urldata.localpath): 101 if self.supports_checksum(urldata) and not os.path.exists(urldata.localpath):
102 locations = [] 102 locations = []
103 filespath = data.getVar('FILESPATH', d, True) 103 filespath = d.getVar('FILESPATH', True)
104 if filespath: 104 if filespath:
105 locations = filespath.split(":") 105 locations = filespath.split(":")
106 filesdir = data.getVar('FILESDIR', d, True) 106 filesdir = d.getVar('FILESDIR', True)
107 if filesdir: 107 if filesdir:
108 locations.append(filesdir) 108 locations.append(filesdir)
109 locations.append(d.getVar("DL_DIR", True)) 109 locations.append(d.getVar("DL_DIR", True))
diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
index c3e02e47f0..66ab075b1c 100644
--- a/bitbake/lib/bb/fetch2/npm.py
+++ b/bitbake/lib/bb/fetch2/npm.py
@@ -90,7 +90,7 @@ class Npm(FetchMethod):
90 self.basecmd = d.getVar("FETCHCMD_wget", True) or "/usr/bin/env wget -O -t 2 -T 30 -nv --passive-ftp --no-check-certificate " 90 self.basecmd = d.getVar("FETCHCMD_wget", True) or "/usr/bin/env wget -O -t 2 -T 30 -nv --passive-ftp --no-check-certificate "
91 ud.prefixdir = prefixdir 91 ud.prefixdir = prefixdir
92 92
93 ud.write_tarballs = ((data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True) or "0") != "0") 93 ud.write_tarballs = ((d.getVar("BB_GENERATE_MIRROR_TARBALLS", True) or "0") != "0")
94 ud.mirrortarball = 'npm_%s-%s.tar.xz' % (ud.pkgname, ud.version) 94 ud.mirrortarball = 'npm_%s-%s.tar.xz' % (ud.pkgname, ud.version)
95 ud.fullmirror = os.path.join(d.getVar("DL_DIR", True), ud.mirrortarball) 95 ud.fullmirror = os.path.join(d.getVar("DL_DIR", True), ud.mirrortarball)
96 96
diff --git a/bitbake/lib/bb/fetch2/repo.py b/bitbake/lib/bb/fetch2/repo.py
index ecc6e68e97..bfd4ae16aa 100644
--- a/bitbake/lib/bb/fetch2/repo.py
+++ b/bitbake/lib/bb/fetch2/repo.py
@@ -51,17 +51,17 @@ class Repo(FetchMethod):
51 if not ud.manifest.endswith('.xml'): 51 if not ud.manifest.endswith('.xml'):
52 ud.manifest += '.xml' 52 ud.manifest += '.xml'
53 53
54 ud.localfile = data.expand("repo_%s%s_%s_%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch), d) 54 ud.localfile = d.expand("repo_%s%s_%s_%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch))
55 55
56 def download(self, ud, d): 56 def download(self, ud, d):
57 """Fetch url""" 57 """Fetch url"""
58 58
59 if os.access(os.path.join(data.getVar("DL_DIR", d, True), ud.localfile), os.R_OK): 59 if os.access(os.path.join(d.getVar("DL_DIR", True), ud.localfile), os.R_OK):
60 logger.debug(1, "%s already exists (or was stashed). Skipping repo init / sync.", ud.localpath) 60 logger.debug(1, "%s already exists (or was stashed). Skipping repo init / sync.", ud.localpath)
61 return 61 return
62 62
63 gitsrcname = "%s%s" % (ud.host, ud.path.replace("/", ".")) 63 gitsrcname = "%s%s" % (ud.host, ud.path.replace("/", "."))
64 repodir = data.getVar("REPODIR", d, True) or os.path.join(data.getVar("DL_DIR", d, True), "repo") 64 repodir = d.getVar("REPODIR", True) or os.path.join(d.getVar("DL_DIR", True), "repo")
65 codir = os.path.join(repodir, gitsrcname, ud.manifest) 65 codir = os.path.join(repodir, gitsrcname, ud.manifest)
66 66
67 if ud.user: 67 if ud.user:
diff --git a/bitbake/lib/bb/fetch2/sftp.py b/bitbake/lib/bb/fetch2/sftp.py
index 7989fccc75..48ddfc176a 100644
--- a/bitbake/lib/bb/fetch2/sftp.py
+++ b/bitbake/lib/bb/fetch2/sftp.py
@@ -92,7 +92,7 @@ class SFTP(FetchMethod):
92 else: 92 else:
93 ud.basename = os.path.basename(ud.path) 93 ud.basename = os.path.basename(ud.path)
94 94
95 ud.localfile = data.expand(urllib.parse.unquote(ud.basename), d) 95 ud.localfile = d.expand(urllib.parse.unquote(ud.basename))
96 96
97 def download(self, ud, d): 97 def download(self, ud, d):
98 """Fetch urls""" 98 """Fetch urls"""
@@ -104,7 +104,7 @@ class SFTP(FetchMethod):
104 port = '-P %d' % urlo.port 104 port = '-P %d' % urlo.port
105 urlo.port = None 105 urlo.port = None
106 106
107 dldir = data.getVar('DL_DIR', d, True) 107 dldir = d.getVar('DL_DIR', True)
108 lpath = os.path.join(dldir, ud.localfile) 108 lpath = os.path.join(dldir, ud.localfile)
109 109
110 user = '' 110 user = ''
diff --git a/bitbake/lib/bb/tests/codeparser.py b/bitbake/lib/bb/tests/codeparser.py
index 14f0e2572c..b80c315d3d 100644
--- a/bitbake/lib/bb/tests/codeparser.py
+++ b/bitbake/lib/bb/tests/codeparser.py
@@ -68,7 +68,7 @@ class VariableReferenceTest(ReferenceTest):
68 68
69 def test_python_reference(self): 69 def test_python_reference(self):
70 self.setEmptyVars(["BAR"]) 70 self.setEmptyVars(["BAR"])
71 self.parseExpression("${@bb.data.getVar('BAR', d, True) + 'foo'}") 71 self.parseExpression("${@d.getVar('BAR', True) + 'foo'}")
72 self.assertReferences(set(["BAR"])) 72 self.assertReferences(set(["BAR"]))
73 73
74class ShellReferenceTest(ReferenceTest): 74class ShellReferenceTest(ReferenceTest):
@@ -209,17 +209,17 @@ be. These unit tests are testing snippets."""
209 return " " + value 209 return " " + value
210 210
211 def test_getvar_reference(self): 211 def test_getvar_reference(self):
212 self.parseExpression("bb.data.getVar('foo', d, True)") 212 self.parseExpression("d.getVar('foo', True)")
213 self.assertReferences(set(["foo"])) 213 self.assertReferences(set(["foo"]))
214 self.assertExecs(set()) 214 self.assertExecs(set())
215 215
216 def test_getvar_computed_reference(self): 216 def test_getvar_computed_reference(self):
217 self.parseExpression("bb.data.getVar('f' + 'o' + 'o', d, True)") 217 self.parseExpression("d.getVar('f' + 'o' + 'o', True)")
218 self.assertReferences(set()) 218 self.assertReferences(set())
219 self.assertExecs(set()) 219 self.assertExecs(set())
220 220
221 def test_getvar_exec_reference(self): 221 def test_getvar_exec_reference(self):
222 self.parseExpression("eval('bb.data.getVar(\"foo\", d, True)')") 222 self.parseExpression("eval('d.getVar(\"foo\", True)')")
223 self.assertReferences(set()) 223 self.assertReferences(set())
224 self.assertExecs(set(["eval"])) 224 self.assertExecs(set(["eval"]))
225 225
@@ -269,7 +269,7 @@ be. These unit tests are testing snippets."""
269class DependencyReferenceTest(ReferenceTest): 269class DependencyReferenceTest(ReferenceTest):
270 270
271 pydata = """ 271 pydata = """
272bb.data.getVar('somevar', d, True) 272d.getVar('somevar', True)
273def test(d): 273def test(d):
274 foo = 'bar %s' % 'foo' 274 foo = 'bar %s' % 'foo'
275def test2(d): 275def test2(d):
@@ -285,9 +285,9 @@ def a():
285 285
286test(d) 286test(d)
287 287
288bb.data.expand(bb.data.getVar("something", False, d), d) 288bb.data.expand(d.getVar("something", False), d)
289bb.data.expand("${inexpand} somethingelse", d) 289bb.data.expand("${inexpand} somethingelse", d)
290bb.data.getVar(a(), d, False) 290d.getVar(a(), False)
291""" 291"""
292 292
293 def test_python(self): 293 def test_python(self):