From aed19f1219605f9cda7431e5df91a94b7f46a08d Mon Sep 17 00:00:00 2001 From: caffeaulait Date: Fri, 29 Jan 2021 15:40:48 +0800 Subject: [PATCH 1/3] add support for outputting all new versions (oa_upgradable) --- advisors/oa_upgradable.py | 1 + advisors/version_recommend.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/advisors/oa_upgradable.py b/advisors/oa_upgradable.py index cde171fa..3393b29a 100755 --- a/advisors/oa_upgradable.py +++ b/advisors/oa_upgradable.py @@ -141,6 +141,7 @@ def main_process(push, default, repo): print("Latest version is", ver_rec.latest_version) print("Maintain version is", ver_rec.maintain_version) + print("Newer Versions are", ver_rec.newer_versions) if cur_version != ver_rec.latest_version: if push: diff --git a/advisors/version_recommend.py b/advisors/version_recommend.py index bd853b9c..970ba047 100755 --- a/advisors/version_recommend.py +++ b/advisors/version_recommend.py @@ -81,6 +81,13 @@ class VersionType(object): _ = version_entry, pkg_type return current_version + def newer_versions(self, version_entry, current_version): + candidate_versions = [] + for version in version_entry: + if self.compare(version, current_version) == 1: + candidate_versions.append(version) + return candidate_versions + def compare(self, _z1, _z2): """ Get the max version. @@ -119,6 +126,7 @@ class VersionType(object): if int(_d1[index]) < int(_d2[index]): result = -1 break + continue if _d1[index].isdigit(): result = 1 @@ -696,6 +704,7 @@ class VersionRecommend(object): print('version type = ', self.version_type.get_version_mode()) self.latest_version = self._get_latest_version(version_entry) self.maintain_version = self._get_maintain_version(version_entry, current_version, pkg_type) + self.newer_versions = self._get_newer_versions(version_entry, current_version) def version_match(self, version_entry): """ @@ -783,3 +792,8 @@ class VersionRecommend(object): if self.version_type is None: return '' return self.version_type.maintain_version(version_entry, current_version, pkg_type) + + def _get_newer_versions(self, version_entry, current_version): + if self.version_type is None: + return '' + return self.version_type.newer_versions(version_entry, current_version) -- Gitee From 5c368ee7c77123bd15bea5bca33f2270806960ac Mon Sep 17 00:00:00 2001 From: peulerosci <> Date: Tue, 2 Feb 2021 19:38:28 +0800 Subject: [PATCH 2/3] . --- ddd.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ddd.txt diff --git a/ddd.txt b/ddd.txt new file mode 100644 index 00000000..e69de29b -- Gitee From 7d0dedd6d6ac0577bab2dfe323cbbde71b6d9521 Mon Sep 17 00:00:00 2001 From: peulerosci <> Date: Fri, 5 Feb 2021 14:41:44 +0800 Subject: [PATCH 3/3] . --- recommend.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 recommend.sh diff --git a/recommend.sh b/recommend.sh new file mode 100644 index 00000000..965ef33c --- /dev/null +++ b/recommend.sh @@ -0,0 +1,4 @@ +#!/bin/sh +source ./develop_env.sh && cd advisors/ && python3 oa_upgradable.py $1 + + -- Gitee