summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Freyther <ich@tamarin.(none)>2009-05-17 06:06:14 +0200
committerRichard Purdie <rpurdie@linux.intel.com>2010-02-10 16:31:19 +0000
commit242a03607d752c228e909a65bf4dfbe8661d5355 (patch)
tree0a17f345f63f1fc8ee23b20c223b9194540ce21d
parentbf6a4fd658a3c07edd4565c6a139537fa10fd456 (diff)
downloadpoky-242a03607d752c228e909a65bf4dfbe8661d5355.tar.gz
bitbake: [parser] Kill obtain/localpath from the parser
With obtain it was possible to use an existing fetcher to download a bb or config file. In practive no one has used it and it was likely broken in regard to depends_cache... Remove it for now, simplfiy the code. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r--bitbake/lib/bb/parse/parse_py/BBHandler.py6
-rw-r--r--bitbake/lib/bb/parse/parse_py/ConfHandler.py51
2 files changed, 3 insertions, 54 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py
index 86fa18ebd2..7707705aaf 100644
--- a/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -29,7 +29,7 @@ import re, bb, os, sys, time, string
29import bb.fetch, bb.build, bb.utils 29import bb.fetch, bb.build, bb.utils
30from bb import data, fetch, methodpool 30from bb import data, fetch, methodpool
31 31
32from ConfHandler import include, localpath, obtain, init 32from ConfHandler import include, init
33from bb.parse import ParseError 33from bb.parse import ParseError
34 34
35__func_start_regexp__ = re.compile( r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" ) 35__func_start_regexp__ = re.compile( r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" )
@@ -57,8 +57,7 @@ IN_PYTHON_EOF = -9999999999999
57__parsed_methods__ = methodpool.get_parsed_dict() 57__parsed_methods__ = methodpool.get_parsed_dict()
58 58
59def supports(fn, d): 59def supports(fn, d):
60 localfn = localpath(fn, d) 60 return fn[-3:] == ".bb" or fn[-8:] == ".bbclass" or fn[-4:] == ".inc"
61 return localfn[-3:] == ".bb" or localfn[-8:] == ".bbclass" or localfn[-4:] == ".inc"
62 61
63def inherit(files, d): 62def inherit(files, d):
64 __inherit_cache = data.getVar('__inherit_cache', d) or [] 63 __inherit_cache = data.getVar('__inherit_cache', d) or []
@@ -146,7 +145,6 @@ def handle(fn, d, include = 0):
146 else: 145 else:
147 oldfile = None 146 oldfile = None
148 147
149 fn = obtain(fn, d)
150 bbpath = (data.getVar('BBPATH', d, 1) or '').split(':') 148 bbpath = (data.getVar('BBPATH', d, 1) or '').split(':')
151 if not os.path.isabs(fn): 149 if not os.path.isabs(fn):
152 f = None 150 f = None
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
index 23316ada58..fcbf6aea15 100644
--- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
@@ -47,55 +47,7 @@ def init(data):
47 47
48 48
49def supports(fn, d): 49def supports(fn, d):
50 return localpath(fn, d)[-5:] == ".conf" 50 return fn[-5:] == ".conf"
51
52def localpath(fn, d):
53 if os.path.exists(fn):
54 return fn
55
56 if "://" not in fn:
57 return fn
58
59 localfn = None
60 try:
61 localfn = bb.fetch.localpath(fn, d, False)
62 except bb.MalformedUrl:
63 pass
64
65 if not localfn:
66 return fn
67 return localfn
68
69def obtain(fn, data):
70 import sys, bb
71 fn = bb.data.expand(fn, data)
72 localfn = bb.data.expand(localpath(fn, data), data)
73
74 if localfn != fn:
75 dldir = bb.data.getVar('DL_DIR', data, 1)
76 if not dldir:
77 bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: DL_DIR not defined")
78 return localfn
79 bb.mkdirhier(dldir)
80 try:
81 bb.fetch.init([fn], data)
82 except bb.fetch.NoMethodError:
83 (type, value, traceback) = sys.exc_info()
84 bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: no method: %s" % value)
85 return localfn
86
87 try:
88 bb.fetch.go(data)
89 except bb.fetch.MissingParameterError:
90 (type, value, traceback) = sys.exc_info()
91 bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: missing parameters: %s" % value)
92 return localfn
93 except bb.fetch.FetchError:
94 (type, value, traceback) = sys.exc_info()
95 bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: failed: %s" % value)
96 return localfn
97 return localfn
98
99 51
100def include(oldfn, fn, data, error_out): 52def include(oldfn, fn, data, error_out):
101 """ 53 """
@@ -136,7 +88,6 @@ def handle(fn, data, include = 0):
136 else: 88 else:
137 oldfile = bb.data.getVar('FILE', data) 89 oldfile = bb.data.getVar('FILE', data)
138 90
139 fn = obtain(fn, data)
140 if not os.path.isabs(fn): 91 if not os.path.isabs(fn):
141 f = None 92 f = None
142 bbpath = bb.data.getVar("BBPATH", data, 1) or [] 93 bbpath = bb.data.getVar("BBPATH", data, 1) or []