]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake: [parser] Kill obtain/localpath from the parser
authorHolger Freyther <ich@tamarin.(none)>
Sun, 17 May 2009 04:06:14 +0000 (06:06 +0200)
committerRichard Purdie <rpurdie@linux.intel.com>
Wed, 10 Feb 2010 16:31:19 +0000 (16:31 +0000)
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>
bitbake/lib/bb/parse/parse_py/BBHandler.py
bitbake/lib/bb/parse/parse_py/ConfHandler.py

index 86fa18ebd22c326a9f875c04393850ae95447297..7707705aaf306e5079149ff230eb72083d9e40e2 100644 (file)
@@ -29,7 +29,7 @@ import re, bb, os, sys, time, string
 import bb.fetch, bb.build, bb.utils
 from bb import data, fetch, methodpool
 
-from ConfHandler import include, localpath, obtain, init
+from ConfHandler import include, init
 from bb.parse import ParseError
 
 __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
 __parsed_methods__ = methodpool.get_parsed_dict()
 
 def supports(fn, d):
-    localfn = localpath(fn, d)
-    return localfn[-3:] == ".bb" or localfn[-8:] == ".bbclass" or localfn[-4:] == ".inc"
+    return fn[-3:] == ".bb" or fn[-8:] == ".bbclass" or fn[-4:] == ".inc"
 
 def inherit(files, d):
     __inherit_cache = data.getVar('__inherit_cache', d) or []
@@ -146,7 +145,6 @@ def handle(fn, d, include = 0):
     else:
         oldfile = None
 
-    fn = obtain(fn, d)
     bbpath = (data.getVar('BBPATH', d, 1) or '').split(':')
     if not os.path.isabs(fn):
         f = None
index 23316ada584fee494ea5519f2cdc6ed1321e985d..fcbf6aea155ed917d5c222f66dfead198ea6efc5 100644 (file)
@@ -47,55 +47,7 @@ def init(data):
 
 
 def supports(fn, d):
-    return localpath(fn, d)[-5:] == ".conf"
-
-def localpath(fn, d):
-    if os.path.exists(fn):
-        return fn
-
-    if "://" not in fn:
-        return fn
-
-    localfn = None
-    try:
-        localfn = bb.fetch.localpath(fn, d, False)
-    except bb.MalformedUrl:
-        pass
-
-    if not localfn:
-        return fn
-    return localfn
-
-def obtain(fn, data):
-    import sys, bb
-    fn = bb.data.expand(fn, data)
-    localfn = bb.data.expand(localpath(fn, data), data)
-
-    if localfn != fn:
-        dldir = bb.data.getVar('DL_DIR', data, 1)
-        if not dldir:
-            bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: DL_DIR not defined")
-            return localfn
-        bb.mkdirhier(dldir)
-        try:
-            bb.fetch.init([fn], data)
-        except bb.fetch.NoMethodError:
-            (type, value, traceback) = sys.exc_info()
-            bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: no method: %s" % value)
-            return localfn
-
-        try:
-            bb.fetch.go(data)
-        except bb.fetch.MissingParameterError:
-            (type, value, traceback) = sys.exc_info()
-            bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: missing parameters: %s" % value)
-            return localfn
-        except bb.fetch.FetchError:
-            (type, value, traceback) = sys.exc_info()
-            bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: failed: %s" % value)
-            return localfn
-    return localfn
-
+    return fn[-5:] == ".conf"
 
 def include(oldfn, fn, data, error_out):
     """
@@ -136,7 +88,6 @@ def handle(fn, data, include = 0):
     else:
         oldfile = bb.data.getVar('FILE', data)
 
-    fn = obtain(fn, data)
     if not os.path.isabs(fn):
         f = None
         bbpath = bb.data.getVar("BBPATH", data, 1) or []