From b16192c93834d0a6530169557aa34122e1417bcf Mon Sep 17 00:00:00 2001 From: Andre McCurdy Date: Mon, 27 Feb 2017 15:14:09 -0800 Subject: bitbake: fetch2: don't use deprecated bb.data APIs Cleanup some more usage of bb.data APIs in the fetchers. (Bitbake rev: 9752fd1c10b8fcc819822fa6eabc2c1050fcc03b) Signed-off-by: Andre McCurdy Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/bzr.py | 7 +++---- bitbake/lib/bb/fetch2/clearcase.py | 1 - bitbake/lib/bb/fetch2/cvs.py | 2 +- bitbake/lib/bb/fetch2/git.py | 1 - bitbake/lib/bb/fetch2/gitannex.py | 1 - bitbake/lib/bb/fetch2/gitsm.py | 1 - bitbake/lib/bb/fetch2/hg.py | 1 - bitbake/lib/bb/fetch2/local.py | 1 - bitbake/lib/bb/fetch2/osc.py | 5 ++--- bitbake/lib/bb/fetch2/perforce.py | 3 +-- bitbake/lib/bb/fetch2/repo.py | 1 - bitbake/lib/bb/fetch2/sftp.py | 2 -- bitbake/lib/bb/fetch2/ssh.py | 1 - bitbake/lib/bb/fetch2/svn.py | 5 ++--- bitbake/lib/bb/fetch2/wget.py | 5 ++--- 15 files changed, 11 insertions(+), 26 deletions(-) (limited to 'bitbake/lib/bb') diff --git a/bitbake/lib/bb/fetch2/bzr.py b/bitbake/lib/bb/fetch2/bzr.py index 0f1c420ef7..16123f8af9 100644 --- a/bitbake/lib/bb/fetch2/bzr.py +++ b/bitbake/lib/bb/fetch2/bzr.py @@ -27,7 +27,6 @@ import os import sys import logging import bb -from bb import data from bb.fetch2 import FetchMethod from bb.fetch2 import FetchError from bb.fetch2 import runfetchcmd @@ -43,14 +42,14 @@ class Bzr(FetchMethod): """ # Create paths to bzr checkouts relpath = self._strip_leading_slashes(ud.path) - ud.pkgdir = os.path.join(data.expand('${BZRDIR}', d), ud.host, relpath) + ud.pkgdir = os.path.join(d.expand('${BZRDIR}'), ud.host, relpath) ud.setup_revisions(d) if not ud.revision: ud.revision = self.latest_revision(ud, d) - ud.localfile = data.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision), d) + ud.localfile = d.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision)) def _buildbzrcommand(self, ud, d, command): """ @@ -58,7 +57,7 @@ class Bzr(FetchMethod): command is "fetch", "update", "revno" """ - basecmd = data.expand('${FETCHCMD_bzr}', d) + basecmd = d.expand('${FETCHCMD_bzr}') proto = ud.parm.get('protocol', 'http') diff --git a/bitbake/lib/bb/fetch2/clearcase.py b/bitbake/lib/bb/fetch2/clearcase.py index 8df8f53d2f..36beab6a5b 100644 --- a/bitbake/lib/bb/fetch2/clearcase.py +++ b/bitbake/lib/bb/fetch2/clearcase.py @@ -65,7 +65,6 @@ import os import sys import shutil import bb -from bb import data from bb.fetch2 import FetchMethod from bb.fetch2 import FetchError from bb.fetch2 import runfetchcmd diff --git a/bitbake/lib/bb/fetch2/cvs.py b/bitbake/lib/bb/fetch2/cvs.py index 64c50c2165..490c954718 100644 --- a/bitbake/lib/bb/fetch2/cvs.py +++ b/bitbake/lib/bb/fetch2/cvs.py @@ -63,7 +63,7 @@ class Cvs(FetchMethod): if 'fullpath' in ud.parm: fullpath = '_fullpath' - ud.localfile = bb.data.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath), d) + ud.localfile = d.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath)) def need_update(self, ud, d): if (ud.date == "now"): diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 0a5785d486..0779e809a3 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py @@ -76,7 +76,6 @@ import re import bb import errno import bb.progress -from bb import data from bb.fetch2 import FetchMethod from bb.fetch2 import runfetchcmd from bb.fetch2 import logger diff --git a/bitbake/lib/bb/fetch2/gitannex.py b/bitbake/lib/bb/fetch2/gitannex.py index 4937a10891..c66c211428 100644 --- a/bitbake/lib/bb/fetch2/gitannex.py +++ b/bitbake/lib/bb/fetch2/gitannex.py @@ -22,7 +22,6 @@ BitBake 'Fetch' git annex implementation import os import bb -from bb import data from bb.fetch2.git import Git from bb.fetch2 import runfetchcmd from bb.fetch2 import logger diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py index 939fb3f09f..a95584c821 100644 --- a/bitbake/lib/bb/fetch2/gitsm.py +++ b/bitbake/lib/bb/fetch2/gitsm.py @@ -31,7 +31,6 @@ NOTE: Switching a SRC_URI from "git://" to "gitsm://" requires a clean of your r import os import bb -from bb import data from bb.fetch2.git import Git from bb.fetch2 import runfetchcmd from bb.fetch2 import logger diff --git a/bitbake/lib/bb/fetch2/hg.py b/bitbake/lib/bb/fetch2/hg.py index ddbebb5f36..b5f268601c 100644 --- a/bitbake/lib/bb/fetch2/hg.py +++ b/bitbake/lib/bb/fetch2/hg.py @@ -29,7 +29,6 @@ import sys import logging import bb import errno -from bb import data from bb.fetch2 import FetchMethod from bb.fetch2 import FetchError from bb.fetch2 import MissingParameterError diff --git a/bitbake/lib/bb/fetch2/local.py b/bitbake/lib/bb/fetch2/local.py index 83778883e0..2ff77234e5 100644 --- a/bitbake/lib/bb/fetch2/local.py +++ b/bitbake/lib/bb/fetch2/local.py @@ -29,7 +29,6 @@ import os import urllib.request, urllib.parse, urllib.error import bb import bb.utils -from bb import data from bb.fetch2 import FetchMethod, FetchError from bb.fetch2 import logger diff --git a/bitbake/lib/bb/fetch2/osc.py b/bitbake/lib/bb/fetch2/osc.py index 26f88e1f46..2b4f7d9c13 100644 --- a/bitbake/lib/bb/fetch2/osc.py +++ b/bitbake/lib/bb/fetch2/osc.py @@ -10,7 +10,6 @@ import os import sys import logging import bb -from bb import data from bb.fetch2 import FetchMethod from bb.fetch2 import FetchError from bb.fetch2 import MissingParameterError @@ -47,7 +46,7 @@ class Osc(FetchMethod): else: ud.revision = "" - ud.localfile = data.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.path.replace('/', '.'), ud.revision), d) + ud.localfile = d.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.path.replace('/', '.'), ud.revision)) def _buildosccommand(self, ud, d, command): """ @@ -55,7 +54,7 @@ class Osc(FetchMethod): command is "fetch", "update", "info" """ - basecmd = data.expand('${FETCHCMD_osc}', d) + basecmd = d.expand('${FETCHCMD_osc}') proto = ud.parm.get('protocol', 'ocs') diff --git a/bitbake/lib/bb/fetch2/perforce.py b/bitbake/lib/bb/fetch2/perforce.py index e00cca90e7..3debad59f4 100644 --- a/bitbake/lib/bb/fetch2/perforce.py +++ b/bitbake/lib/bb/fetch2/perforce.py @@ -26,7 +26,6 @@ BitBake 'Fetch' implementation for perforce import os import logging import bb -from bb import data from bb.fetch2 import FetchMethod from bb.fetch2 import FetchError from bb.fetch2 import logger @@ -89,7 +88,7 @@ class Perforce(FetchMethod): ud.setup_revisions(d) - ud.localfile = data.expand('%s_%s_%s.tar.gz' % (cleanedhost, cleanedpath, ud.revision), d) + ud.localfile = d.expand('%s_%s_%s.tar.gz' % (cleanedhost, cleanedpath, ud.revision)) def _buildp4command(self, ud, d, command, depot_filename=None): """ diff --git a/bitbake/lib/bb/fetch2/repo.py b/bitbake/lib/bb/fetch2/repo.py index 24dcebb0cb..1be91cc698 100644 --- a/bitbake/lib/bb/fetch2/repo.py +++ b/bitbake/lib/bb/fetch2/repo.py @@ -25,7 +25,6 @@ BitBake "Fetch" repo (git) implementation import os import bb -from bb import data from bb.fetch2 import FetchMethod from bb.fetch2 import runfetchcmd diff --git a/bitbake/lib/bb/fetch2/sftp.py b/bitbake/lib/bb/fetch2/sftp.py index da857dd9ff..81884a6aa4 100644 --- a/bitbake/lib/bb/fetch2/sftp.py +++ b/bitbake/lib/bb/fetch2/sftp.py @@ -62,12 +62,10 @@ SRC_URI = "sftp://user@host.example.com/dir/path.file.txt" import os import bb import urllib.request, urllib.parse, urllib.error -from bb import data from bb.fetch2 import URI from bb.fetch2 import FetchMethod from bb.fetch2 import runfetchcmd - class SFTP(FetchMethod): """Class to fetch urls via 'sftp'""" diff --git a/bitbake/lib/bb/fetch2/ssh.py b/bitbake/lib/bb/fetch2/ssh.py index e668b0d4b7..6047ee417a 100644 --- a/bitbake/lib/bb/fetch2/ssh.py +++ b/bitbake/lib/bb/fetch2/ssh.py @@ -43,7 +43,6 @@ IETF secsh internet draft: # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. import re, os -from bb import data from bb.fetch2 import FetchMethod from bb.fetch2 import FetchError from bb.fetch2 import logger diff --git a/bitbake/lib/bb/fetch2/svn.py b/bitbake/lib/bb/fetch2/svn.py index 3271be326c..3f172eec9b 100644 --- a/bitbake/lib/bb/fetch2/svn.py +++ b/bitbake/lib/bb/fetch2/svn.py @@ -28,7 +28,6 @@ import sys import logging import bb import re -from bb import data from bb.fetch2 import FetchMethod from bb.fetch2 import FetchError from bb.fetch2 import MissingParameterError @@ -61,7 +60,7 @@ class Svn(FetchMethod): # Create paths to svn checkouts relpath = self._strip_leading_slashes(ud.path) - ud.pkgdir = os.path.join(data.expand('${SVNDIR}', d), ud.host, relpath) + ud.pkgdir = os.path.join(d.expand('${SVNDIR}'), ud.host, relpath) ud.moddir = os.path.join(ud.pkgdir, ud.module) ud.setup_revisions(d) @@ -69,7 +68,7 @@ class Svn(FetchMethod): if 'rev' in ud.parm: ud.revision = ud.parm['rev'] - ud.localfile = data.expand('%s_%s_%s_%s_.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision), d) + ud.localfile = d.expand('%s_%s_%s_%s_.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision)) def _buildsvncommand(self, ud, d, command): """ diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index 1cc445a426..0c61dfa20d 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py @@ -33,7 +33,6 @@ import logging import bb import bb.progress import urllib.request, urllib.parse, urllib.error -from bb import data from bb.fetch2 import FetchMethod from bb.fetch2 import FetchError from bb.fetch2 import logger @@ -84,9 +83,9 @@ class Wget(FetchMethod): else: ud.basename = os.path.basename(ud.path) - ud.localfile = data.expand(urllib.parse.unquote(ud.basename), d) + ud.localfile = d.expand(urllib.parse.unquote(ud.basename)) if not ud.localfile: - ud.localfile = data.expand(urllib.parse.unquote(ud.host + ud.path).replace("/", "."), d) + ud.localfile = d.expand(urllib.parse.unquote(ud.host + ud.path).replace("/", ".")) self.basecmd = d.getVar("FETCHCMD_wget") or "/usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate" -- cgit v1.2.3-54-g00ecf