[bitbake-devel,6/9] fetch2: declare urldata_init in base class

Submitted by Urs Fässler on July 23, 2018, 3:42 p.m. | Patch ID: 152887

Details

Message ID 20180723154259.9076-7-urs.fassler@bbv.ch
State New
Headers show

Commit Message

Urs Fässler July 23, 2018, 3:42 p.m.
Declare urldata_init in FetchMethod since it is implemented by every
fetcher anyway. Always call urldata_init in FetchData init.

Signed-off-by: Urs Fässler <urs.fassler@bbv.ch>
Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
---
 lib/bb/fetch2/__init__.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index a83526a5..c8653d62 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -1259,8 +1259,7 @@  class FetchData(object):
             logger.warning('Consider updating %s recipe to use "protocol" not "proto" in SRC_URI.', d.getVar('PN'))
             self.parm["protocol"] = self.parm.get("proto", None)
 
-        if hasattr(self.method, "urldata_init"):
-            self.method.urldata_init(self, d)
+        self.method.urldata_init(self, d)
 
         if "localpath" in self.parm:
             # if user sets localpath for file, use it instead.
@@ -1349,6 +1348,12 @@  class FetchMethod(object):
 
         return True
 
+    def urldata_init(self, ud, d):
+        """
+        init method specific variable within url data
+        """
+        pass
+
     def recommends_checksum(self, urldata):
         """
         Is the backend on where checksumming is recommended (should warnings