[releng] fix _get_latest_version when the biggest version is first and over max_version



commit 17d4c4e4f30783a985e650ce42ce91aecc36d6d0
Author: Frédéric Péters <fpeters 0d be>
Date:   Fri Sep 20 16:57:18 2013 +0200

    fix _get_latest_version when the biggest version is first and over max_version

 tools/smoketesting/convert-to-tarballs.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/tools/smoketesting/convert-to-tarballs.py b/tools/smoketesting/convert-to-tarballs.py
index 155de09..ef3e507 100755
--- a/tools/smoketesting/convert-to-tarballs.py
+++ b/tools/smoketesting/convert-to-tarballs.py
@@ -409,9 +409,9 @@ class TarballLocator:
         return True
 
     def _get_latest_version(self, versions, max_version):
-        biggest = versions[0]
-        for version in versions[1:]:
-            if (version == self._bigger_version(biggest, version) and \
+        biggest = None
+        for version in versions:
+            if ((biggest is None or version == self._bigger_version(biggest, version)) and \
                 not self._version_greater_or_equal_to_max(version, max_version)):
                 biggest = version
         return biggest


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]