]> code.ossystems Code Review - openembedded-core.git/commitdiff
fetch/__init__.py: Try and make the sortable_revision code mode readable
authorRichard Purdie <rpurdie@linux.intel.com>
Wed, 4 Nov 2009 00:43:13 +0000 (00:43 +0000)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 13 Nov 2009 12:15:23 +0000 (12:15 +0000)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake-dev/lib/bb/fetch/__init__.py
bitbake-dev/lib/bb/fetch/git.py
bitbake/lib/bb/fetch/__init__.py
bitbake/lib/bb/fetch/git.py

index 429822bfa986c4008d6b423bad4d4036701b8ab2..b8a00107e25f057307d76bd1291bebb7b7c1ad34 100644 (file)
@@ -553,8 +553,12 @@ class Fetch(object):
         """
         
         """
+        has_sortable_valid = hasattr(self, "_sortable_revision_valid")
         has_sortable = hasattr(self, "_sortable_revision")
-        if has_sortable:
+
+        if has_sortable and not has_sortable_valid:
+            return self._sortable_revision(url, ud, d)
+        elif has_sortable and self._sortable_revision_valid(url, ud, d):
             return self._sortable_revision(url, ud, d)
 
         pd = persist_data.PersistData(d)
index c81193774312c807eddd8a30c70930d53f000ba7..911c5e437feb69378be565e86ce1dcb05461a280 100644 (file)
@@ -145,12 +145,12 @@ class Git(Fetch):
     def _build_revision(self, url, ud, d):
         return ud.tag
 
-    def _want_sortable_revision(self, url, ud, d):
+    def _sortable_revision_valid(self, url, ud, d):
         return bb.data.getVar("BB_GIT_CLONE_FOR_SRCREV", d, True) or False
 
-    def _sortable_revision_disabled(self, url, ud, d):
+    def _sortable_revision(self, url, ud, d):
         """
-        This is only called when _want_sortable_revision called true
+        This is only called when _sortable_revision_valid called true
 
         We will have to get the updated revision.
         """
index 429822bfa986c4008d6b423bad4d4036701b8ab2..b8a00107e25f057307d76bd1291bebb7b7c1ad34 100644 (file)
@@ -553,8 +553,12 @@ class Fetch(object):
         """
         
         """
+        has_sortable_valid = hasattr(self, "_sortable_revision_valid")
         has_sortable = hasattr(self, "_sortable_revision")
-        if has_sortable:
+
+        if has_sortable and not has_sortable_valid:
+            return self._sortable_revision(url, ud, d)
+        elif has_sortable and self._sortable_revision_valid(url, ud, d):
             return self._sortable_revision(url, ud, d)
 
         pd = persist_data.PersistData(d)
index c81193774312c807eddd8a30c70930d53f000ba7..911c5e437feb69378be565e86ce1dcb05461a280 100644 (file)
@@ -145,12 +145,12 @@ class Git(Fetch):
     def _build_revision(self, url, ud, d):
         return ud.tag
 
-    def _want_sortable_revision(self, url, ud, d):
+    def _sortable_revision_valid(self, url, ud, d):
         return bb.data.getVar("BB_GIT_CLONE_FOR_SRCREV", d, True) or False
 
-    def _sortable_revision_disabled(self, url, ud, d):
+    def _sortable_revision(self, url, ud, d):
         """
-        This is only called when _want_sortable_revision called true
+        This is only called when _sortable_revision_valid called true
 
         We will have to get the updated revision.
         """