summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index c7e058d0d6..cf9456b758 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -201,7 +201,7 @@ def fetcher_init(d):
201 """ 201 """
202 pd = persist_data.persist(d) 202 pd = persist_data.persist(d)
203 # When to drop SCM head revisions controlled by user policy 203 # When to drop SCM head revisions controlled by user policy
204 srcrev_policy = bb.data.getVar('BB_SRCREV_POLICY', d, 1) or "clear" 204 srcrev_policy = bb.data.getVar('BB_SRCREV_POLICY', d, True) or "clear"
205 if srcrev_policy == "cache": 205 if srcrev_policy == "cache":
206 logger.debug(1, "Keeping SRCREV cache due to cache policy of: %s", srcrev_policy) 206 logger.debug(1, "Keeping SRCREV cache due to cache policy of: %s", srcrev_policy)
207 elif srcrev_policy == "clear": 207 elif srcrev_policy == "clear":
@@ -322,7 +322,7 @@ def get_srcrev(d):
322 # 322 #
323 # Mutiple SCMs are in SRC_URI so we resort to SRCREV_FORMAT 323 # Mutiple SCMs are in SRC_URI so we resort to SRCREV_FORMAT
324 # 324 #
325 format = bb.data.getVar('SRCREV_FORMAT', d, 1) 325 format = bb.data.getVar('SRCREV_FORMAT', d, True)
326 if not format: 326 if not format:
327 raise FetchError("The SRCREV_FORMAT variable must be set when multiple SCMs are used.") 327 raise FetchError("The SRCREV_FORMAT variable must be set when multiple SCMs are used.")
328 328
@@ -410,7 +410,7 @@ def try_mirrors(d, uri, mirrors, check = False, force = False):
410 uri is the original uri we're trying to download 410 uri is the original uri we're trying to download
411 mirrors is the list of mirrors we're going to try 411 mirrors is the list of mirrors we're going to try
412 """ 412 """
413 fpath = os.path.join(data.getVar("DL_DIR", d, 1), os.path.basename(uri)) 413 fpath = os.path.join(data.getVar("DL_DIR", d, True), os.path.basename(uri))
414 if not check and os.access(fpath, os.R_OK) and not force: 414 if not check and os.access(fpath, os.R_OK) and not force:
415 logger.debug(1, "%s already exists, skipping checkout.", fpath) 415 logger.debug(1, "%s already exists, skipping checkout.", fpath)
416 return fpath 416 return fpath
@@ -463,12 +463,12 @@ def srcrev_internal_helper(ud, d, name):
463 463
464 rev = None 464 rev = None
465 if name != '': 465 if name != '':
466 pn = data.getVar("PN", d, 1) 466 pn = data.getVar("PN", d, True)
467 rev = data.getVar("SRCREV_%s_pn-%s" % (name, pn), d, 1) 467 rev = data.getVar("SRCREV_%s_pn-%s" % (name, pn), d, True)
468 if not rev: 468 if not rev:
469 rev = data.getVar("SRCREV_%s" % name, d, 1) 469 rev = data.getVar("SRCREV_%s" % name, d, True)
470 if not rev: 470 if not rev:
471 rev = data.getVar("SRCREV", d, 1) 471 rev = data.getVar("SRCREV", d, True)
472 if rev == "INVALID": 472 if rev == "INVALID":
473 raise FetchError("Please set SRCREV to a valid value", ud.url) 473 raise FetchError("Please set SRCREV to a valid value", ud.url)
474 if rev == "AUTOINC": 474 if rev == "AUTOINC":
@@ -618,7 +618,7 @@ class FetchMethod(object):
618 file = urldata.localpath 618 file = urldata.localpath
619 dots = file.split(".") 619 dots = file.split(".")
620 if dots[-1] in ['gz', 'bz2', 'Z']: 620 if dots[-1] in ['gz', 'bz2', 'Z']:
621 efile = os.path.join(bb.data.getVar('WORKDIR', data, 1),os.path.basename('.'.join(dots[0:-1]))) 621 efile = os.path.join(bb.data.getVar('WORKDIR', data, True),os.path.basename('.'.join(dots[0:-1])))
622 else: 622 else:
623 efile = file 623 efile = file
624 cmd = None 624 cmd = None
@@ -642,7 +642,7 @@ class FetchMethod(object):
642 cmd = '%s -a' % cmd 642 cmd = '%s -a' % cmd
643 cmd = "%s '%s'" % (cmd, file) 643 cmd = "%s '%s'" % (cmd, file)
644 elif os.path.isdir(file): 644 elif os.path.isdir(file):
645 filesdir = os.path.realpath(bb.data.getVar("FILESDIR", data, 1)) 645 filesdir = os.path.realpath(bb.data.getVar("FILESDIR", data, True))
646 destdir = "." 646 destdir = "."
647 if file[0:len(filesdir)] == filesdir: 647 if file[0:len(filesdir)] == filesdir:
648 destdir = file[len(filesdir):file.rfind('/')] 648 destdir = file[len(filesdir):file.rfind('/')]
@@ -679,7 +679,7 @@ class FetchMethod(object):
679 bb.mkdirhier(newdir) 679 bb.mkdirhier(newdir)
680 os.chdir(newdir) 680 os.chdir(newdir)
681 681
682 cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', data, 1), cmd) 682 cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', data, True), cmd)
683 bb.note("Unpacking %s to %s/" % (file, os.getcwd())) 683 bb.note("Unpacking %s to %s/" % (file, os.getcwd()))
684 ret = subprocess.call(cmd, preexec_fn=subprocess_setup, shell=True) 684 ret = subprocess.call(cmd, preexec_fn=subprocess_setup, shell=True)
685 685
@@ -718,10 +718,10 @@ class FetchMethod(object):
718 718
719 localcount = None 719 localcount = None
720 if name != '': 720 if name != '':
721 pn = data.getVar("PN", d, 1) 721 pn = data.getVar("PN", d, True)
722 localcount = data.getVar("LOCALCOUNT_" + name, d, 1) 722 localcount = data.getVar("LOCALCOUNT_" + name, d, True)
723 if not localcount: 723 if not localcount:
724 localcount = data.getVar("LOCALCOUNT", d, 1) 724 localcount = data.getVar("LOCALCOUNT", d, True)
725 return localcount 725 return localcount
726 726
727 localcount_internal_helper = staticmethod(localcount_internal_helper) 727 localcount_internal_helper = staticmethod(localcount_internal_helper)
@@ -789,12 +789,12 @@ class FetchMethod(object):
789class Fetch(object): 789class Fetch(object):
790 def __init__(self, urls, d): 790 def __init__(self, urls, d):
791 if len(urls) == 0: 791 if len(urls) == 0:
792 urls = d.getVar("SRC_URI", 1).split() 792 urls = d.getVar("SRC_URI", True).split()
793 self.urls = urls 793 self.urls = urls
794 self.d = d 794 self.d = d
795 self.ud = {} 795 self.ud = {}
796 796
797 fn = bb.data.getVar('FILE', d, 1) 797 fn = bb.data.getVar('FILE', d, True)
798 if fn in urldata_cache: 798 if fn in urldata_cache:
799 self.ud = urldata_cache[fn] 799 self.ud = urldata_cache[fn]
800 800