mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 18:49:32 +02:00
bb.fetch2: rename "go" with "download" to better reflect its functionality
no functional change Signed-off-by: Yu Ke <ke.yu@intel.com>
This commit is contained in:
@@ -263,7 +263,7 @@ def subprocess_setup():
|
|||||||
# SIGPIPE errors are known issues with gzip/bash
|
# SIGPIPE errors are known issues with gzip/bash
|
||||||
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
|
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
|
||||||
|
|
||||||
def go(d, urls = None):
|
def download(d, urls = None):
|
||||||
"""
|
"""
|
||||||
Fetch all urls
|
Fetch all urls
|
||||||
init must have previously been called
|
init must have previously been called
|
||||||
@@ -293,7 +293,7 @@ def go(d, urls = None):
|
|||||||
if m.forcefetch(u, ud, d) or not localpath:
|
if m.forcefetch(u, ud, d) or not localpath:
|
||||||
# Next try fetching from the original uri, u
|
# Next try fetching from the original uri, u
|
||||||
try:
|
try:
|
||||||
m.go(u, ud, d)
|
m.download(u, ud, d)
|
||||||
localpath = ud.localpath
|
localpath = ud.localpath
|
||||||
except FetchError:
|
except FetchError:
|
||||||
# Remove any incomplete file
|
# Remove any incomplete file
|
||||||
@@ -499,7 +499,7 @@ def try_mirrors(d, uri, mirrors, check = False, force = False):
|
|||||||
if found:
|
if found:
|
||||||
return found
|
return found
|
||||||
else:
|
else:
|
||||||
ud.method.go(newuri, ud, ld)
|
ud.method.download(newuri, ud, ld)
|
||||||
return ud.localpath
|
return ud.localpath
|
||||||
except (bb.fetch2.MissingParameterError,
|
except (bb.fetch2.MissingParameterError,
|
||||||
bb.fetch2.FetchError,
|
bb.fetch2.FetchError,
|
||||||
@@ -626,7 +626,7 @@ class Fetch(object):
|
|||||||
"""
|
"""
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def go(self, url, urldata, d):
|
def download(self, url, urldata, d):
|
||||||
"""
|
"""
|
||||||
Fetch urls
|
Fetch urls
|
||||||
Assumes localpath was called first
|
Assumes localpath was called first
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class Bzr(Fetch):
|
|||||||
|
|
||||||
return bzrcmd
|
return bzrcmd
|
||||||
|
|
||||||
def go(self, loc, ud, d):
|
def download(self, loc, ud, d):
|
||||||
"""Fetch url"""
|
"""Fetch url"""
|
||||||
|
|
||||||
if os.access(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir), '.bzr'), os.R_OK):
|
if os.access(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir), '.bzr'), os.R_OK):
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class Cvs(Fetch):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def go(self, loc, ud, d):
|
def download(self, loc, ud, d):
|
||||||
|
|
||||||
method = ud.parm.get('method', 'pserver')
|
method = ud.parm.get('method', 'pserver')
|
||||||
localdir = ud.parm.get('localdir', ud.module)
|
localdir = ud.parm.get('localdir', ud.module)
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class Git(Fetch):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def go(self, loc, ud, d):
|
def download(self, loc, ud, d):
|
||||||
"""Fetch url"""
|
"""Fetch url"""
|
||||||
|
|
||||||
if ud.user:
|
if ud.user:
|
||||||
@@ -242,7 +242,7 @@ class Git(Fetch):
|
|||||||
|
|
||||||
if not os.path.exists(ud.clonedir):
|
if not os.path.exists(ud.clonedir):
|
||||||
print("no repo")
|
print("no repo")
|
||||||
self.go(None, ud, d)
|
self.download(None, ud, d)
|
||||||
if not os.path.exists(ud.clonedir):
|
if not os.path.exists(ud.clonedir):
|
||||||
logger.error("GIT repository for %s doesn't exist in %s, cannot get sortable buildnumber, using old value", url, ud.clonedir)
|
logger.error("GIT repository for %s doesn't exist in %s, cannot get sortable buildnumber, using old value", url, ud.clonedir)
|
||||||
return None
|
return None
|
||||||
@@ -250,7 +250,7 @@ class Git(Fetch):
|
|||||||
|
|
||||||
os.chdir(ud.clonedir)
|
os.chdir(ud.clonedir)
|
||||||
if not self._contains_ref(rev, d):
|
if not self._contains_ref(rev, d):
|
||||||
self.go(None, ud, d)
|
self.download(None, ud, d)
|
||||||
|
|
||||||
output = runfetchcmd("%s rev-list %s -- 2> /dev/null | wc -l" % (ud.basecmd, rev), d, quiet=True)
|
output = runfetchcmd("%s rev-list %s -- 2> /dev/null | wc -l" % (ud.basecmd, rev), d, quiet=True)
|
||||||
os.chdir(cwd)
|
os.chdir(cwd)
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ class Hg(Fetch):
|
|||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
|
|
||||||
def go(self, loc, ud, d):
|
def download(self, loc, ud, d):
|
||||||
"""Fetch url"""
|
"""Fetch url"""
|
||||||
|
|
||||||
logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")
|
logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class Local(Fetch):
|
|||||||
# We don't set localfile as for this fetcher the file is already local!
|
# We don't set localfile as for this fetcher the file is already local!
|
||||||
return newpath
|
return newpath
|
||||||
|
|
||||||
def go(self, url, urldata, d):
|
def download(self, url, urldata, d):
|
||||||
"""Fetch urls (no-op for Local method)"""
|
"""Fetch urls (no-op for Local method)"""
|
||||||
# no need to fetch local files, we'll deal with them in place.
|
# no need to fetch local files, we'll deal with them in place.
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class Osc(Fetch):
|
|||||||
|
|
||||||
return osccmd
|
return osccmd
|
||||||
|
|
||||||
def go(self, loc, ud, d):
|
def download(self, loc, ud, d):
|
||||||
"""
|
"""
|
||||||
Fetch url
|
Fetch url
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ class Perforce(Fetch):
|
|||||||
|
|
||||||
return os.path.join(data.getVar("DL_DIR", d, 1), ud.localfile)
|
return os.path.join(data.getVar("DL_DIR", d, 1), ud.localfile)
|
||||||
|
|
||||||
def go(self, loc, ud, d):
|
def download(self, loc, ud, d):
|
||||||
"""
|
"""
|
||||||
Fetch urls
|
Fetch urls
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class Repo(Fetch):
|
|||||||
|
|
||||||
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
|
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
|
||||||
|
|
||||||
def go(self, loc, ud, d):
|
def download(self, loc, ud, d):
|
||||||
"""Fetch url"""
|
"""Fetch url"""
|
||||||
|
|
||||||
if os.access(os.path.join(data.getVar("DL_DIR", d, True), ud.localfile), os.R_OK):
|
if os.access(os.path.join(data.getVar("DL_DIR", d, True), ud.localfile), os.R_OK):
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class SSH(Fetch):
|
|||||||
lpath = os.path.join(data.getVar('DL_DIR', d, True), host, os.path.basename(path))
|
lpath = os.path.join(data.getVar('DL_DIR', d, True), host, os.path.basename(path))
|
||||||
return lpath
|
return lpath
|
||||||
|
|
||||||
def go(self, url, urldata, d):
|
def download(self, url, urldata, d):
|
||||||
dldir = data.getVar('DL_DIR', d, 1)
|
dldir = data.getVar('DL_DIR', d, 1)
|
||||||
|
|
||||||
m = __pattern__.match(url)
|
m = __pattern__.match(url)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class Svk(Fetch):
|
|||||||
def forcefetch(self, url, ud, d):
|
def forcefetch(self, url, ud, d):
|
||||||
return ud.date == "now"
|
return ud.date == "now"
|
||||||
|
|
||||||
def go(self, loc, ud, d):
|
def download(self, loc, ud, d):
|
||||||
"""Fetch urls"""
|
"""Fetch urls"""
|
||||||
|
|
||||||
svkroot = ud.host + ud.path
|
svkroot = ud.host + ud.path
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ class Svn(Fetch):
|
|||||||
|
|
||||||
return svncmd
|
return svncmd
|
||||||
|
|
||||||
def go(self, loc, ud, d):
|
def download(self, loc, ud, d):
|
||||||
"""Fetch url"""
|
"""Fetch url"""
|
||||||
|
|
||||||
logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")
|
logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class Wget(Fetch):
|
|||||||
|
|
||||||
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
|
return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
|
||||||
|
|
||||||
def go(self, uri, ud, d, checkonly = False):
|
def download(self, uri, ud, d, checkonly = False):
|
||||||
"""Fetch urls"""
|
"""Fetch urls"""
|
||||||
|
|
||||||
def fetch_uri(uri, ud, d):
|
def fetch_uri(uri, ud, d):
|
||||||
@@ -90,4 +90,4 @@ class Wget(Fetch):
|
|||||||
|
|
||||||
|
|
||||||
def checkstatus(self, uri, ud, d):
|
def checkstatus(self, uri, ud, d):
|
||||||
return self.go(uri, ud, d, True)
|
return self.download(uri, ud, d, True)
|
||||||
|
|||||||
Reference in New Issue
Block a user