From: pierre Date: Thu, 27 Nov 2014 11:06:57 +0000 (+0100) Subject: ... X-Git-Url: http://iramuteq.org/git?a=commitdiff_plain;h=a1072a79076e10759eab1c10d443169f10e30cb7;p=iramuteq ... --- diff --git a/checkinstall.py b/checkinstall.py index 34b3748..7997353 100644 --- a/checkinstall.py +++ b/checkinstall.py @@ -23,26 +23,49 @@ def IsNew(self): version_user = self.pref.get('iramuteq','version_nb').split('.') except NoOptionError : return True + userab = False + globab = False if version_user : + print len(version_user), len(version_glob) version_user[0] = int(version_user[0]) version_user[1] = int(version_user[1]) version_glob[0] = int(version_glob[0]) version_glob[1] = int(version_glob[1]) + if len(version_user) == 3 : + if 'a' in version_user[2] : + userab = 'a' + version_user[2] = int(version_user[2].replace('a', '')) + elif 'b' in version_user[2] : + userab = 'b' + version_user[2] = int(version_user[2].replace('b', '')) + else : + version_user[2] = int(version_user[2]) + if len(version_glob) == 3 : + if 'a' in version_glob[2] : + globab = 'a' + version_glob[2] = int(version_glob[2].replace('a', '')) + elif 'b' in version_glob[2] : + globab = 'b' + version_glob[2] = int(version_glob[2].replace('b', '')) + else : + version_glob[2] = int(version_glob[2]) if len(version_user) == len(version_glob) : if version_glob > version_user : return True + elif version_glob == version_user : + if globab == userab : + return False + elif globab > userab : + return True + else : + return False else : return False - if len(version_glob) == 2 : - if version_glob[:2] >= version_user[:2] : + else : + if version_glob > version_user : return True else : return False - elif len(version_glob) == 3 : - if version_glob[:2] <= version_user[:2] : - return False - else : - return True def UpgradeConf(self) : log.info('upgrade conf')