[poky] [PATCH 5/8] bzr.py: move bzr specific url data initialization earlier

Yu Ke ke.yu at intel.com
Mon Dec 27 05:57:30 PST 2010


move the url data init earlier, so that Bzr.latest_revision()
can work before Bzr.localpath()

This change allow FetchData:__init__ to set FetchData.revison by
Bzr.latest_revision()

Signed-off-by: Yu Ke <ke.yu at intel.com>
---
 bitbake/lib/bb/fetch/bzr.py |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/bitbake/lib/bb/fetch/bzr.py b/bitbake/lib/bb/fetch/bzr.py
index 2f73adf..b29bbce 100644
--- a/bitbake/lib/bb/fetch/bzr.py
+++ b/bitbake/lib/bb/fetch/bzr.py
@@ -33,10 +33,17 @@ from bb.fetch import runfetchcmd
 
 class Bzr(Fetch):
     def supports(self, url, ud, d):
-        return ud.type in ['bzr']
-
-    def localpath (self, url, ud, d):
+        if ud.type in ['bzr']:
+            self.urldata_init(ud, d)
+            return True
+        else:
+            return False
 
+    def urldata_init(self, ud, d):
+        """
+        init bzr specific variable within url data
+        so that the  method like latest_revision() can work
+        """
         # Create paths to bzr checkouts
         relpath = ud.path
         if relpath.startswith('/'):
@@ -44,6 +51,7 @@ class Bzr(Fetch):
             relpath = relpath[1:]
         ud.pkgdir = os.path.join(data.expand('${BZRDIR}', d), ud.host, relpath)
 
+    def localpath (self, url, ud, d):
         revision = Fetch.srcrev_internal_helper(ud, d)
         if revision is True:
             ud.revision = self.latest_revision(url, ud, d)
-- 
1.7.0.4




More information about the poky mailing list