Univention Bugzilla – Attachment 7826 Details for
Bug 41846
Version check upon app installation is incorrect
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
app_install_version_compare.patch (text/plain), 1.56 KB, created by
Johannes Keiser
on 2016-07-22 16:41:18 CEST
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Johannes Keiser
Created:
2016-07-22 16:41:18 CEST
Size:
1.56 KB
patch
obsolete
>Index: python/appcenter/app.py >=================================================================== >--- python/appcenter/app.py (Revision 71204) >+++ python/appcenter/app.py (Arbeitskopie) >@@ -1004,17 +1004,26 @@ > required_version = self.required_ucs_version > if not required_version: > return True >+ current_version = self.get_current_ucs_version_as_string() >+ >+ if not self.is_fitting_ucs_version(required_version, current_version): >+ return {'required_version': required_version} >+ return True >+ >+ @staticmethod >+ def get_current_ucs_version_as_string(): > ucr_load() >- version_bits = re.match(r'^(\d+)\.(\d+)-(\d+)(?: errata(\d+))?$', required_version).groups() >- major, minor = ucr_get('version/version').split('.', 1) >+ version = ucr_get('version/version') > patchlevel = ucr_get('version/patchlevel') >- errata = ucr_get('version/erratalevel') >- comparisons = zip(version_bits, [major, minor, patchlevel, errata]) >- for required, present in comparisons: >- if int(required or 0) > int(present): >- return {'required_version': required_version} >- return True >+ erratalevel = ucr_get('version/erratalevel') > >+ current_version = '{version}-{patchlevel} errata{erratalevel}'.format(version=version, patchlevel=patchlevel, erratalevel=erratalevel) >+ return current_version >+ >+ @staticmethod >+ def is_fitting_ucs_version(required_version, current_version): # type: (str, str) -> bool >+ return LooseVersion(required_version) <= LooseVersion(current_version) >+ > @hard_requirement('install', 'upgrade') > def must_have_fitting_kernel_version(self): > if self.docker:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 41846
: 7826 |
7827