summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-16 11:19:01 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-23 10:59:56 +0000
commit8de811ae76f8a5bc160e3e3f72da3a5e08b6ca1a (patch)
treed05237b14523de16c128de71d99eed4f8f9e554e /bitbake/lib/bb/fetch2
parent4d8ee55164303544c9cf9c9356448cbc79885815 (diff)
downloadpoky-8de811ae76f8a5bc160e3e3f72da3a5e08b6ca1a.tar.gz
bitbake: lib/bb: Don't use deprecated bb.data.getVar/setVar API
The old style bb.data.getVar/setVar API is obsolete. Most of bitbake doesn't use it but there were some pieces that escaped conversion. This patch fixes the remaining users mostly in the fetchers. (Bitbake rev: ff7892fa808116acc1ac50effa023a4cb031a5fc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-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
8 files changed, 17 insertions, 17 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 = ''