Update parser to work optimally with the new fetcher code
authorRichard Purdie <rpurdie@linux.intel.com>
Sat, 28 Jul 2007 22:59:23 +0000 (22:59 +0000)
committerRichard Purdie <rpurdie@linux.intel.com>
Sat, 28 Jul 2007 22:59:23 +0000 (22:59 +0000)
lib/bb/parse/parse_py/BBHandler.py
lib/bb/parse/parse_py/ConfHandler.py

index 20fa603..5f8426d 100644 (file)
@@ -400,14 +400,14 @@ def set_additional_vars(file, d, include):
 
     from bb import fetch
     try:
-        fetch.init(src_uri.split(), d)
+        ud = fetch.init(src_uri.split(), d)
+        a += fetch.localpaths(d, ud)
     except fetch.NoMethodError:
         pass
     except bb.MalformedUrl,e:
         raise ParseError("Unable to generate local paths for SRC_URI due to malformed uri: %s" % e)
-
-    a += fetch.localpaths(d)
     del fetch
+
     data.setVar('A', " ".join(a), d)
 
 
index 0e05928..6a44e28 100644 (file)
@@ -45,14 +45,17 @@ 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)
+        localfn = bb.fetch.localpath(fn, d, False)
     except bb.MalformedUrl:
         pass
 
     if not localfn:
-        localfn = fn
+        return fn
     return localfn
 
 def obtain(fn, data):
@@ -67,14 +70,14 @@ def obtain(fn, data):
             return localfn
         bb.mkdirhier(dldir)
         try:
-            bb.fetch.init([fn])
+            ud = bb.fetch.init([fn], data, False)
         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)
+            bb.fetch.go(data, ud)
         except bb.fetch.MissingParameterError:
             (type, value, traceback) = sys.exc_info()
             bb.msg.debug(1, bb.msg.domain.Parsing, "obtain: missing parameters: %s" % value)