diff options
Diffstat (limited to 'meta/lib/oe/recipeutils.py')
-rw-r--r-- | meta/lib/oe/recipeutils.py | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index 9c99164d24..39d3de4bb1 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py | |||
@@ -16,8 +16,10 @@ import shutil | |||
16 | import re | 16 | import re |
17 | import fnmatch | 17 | import fnmatch |
18 | import glob | 18 | import glob |
19 | from collections import OrderedDict, defaultdict | 19 | import bb.tinfoil |
20 | 20 | ||
21 | from collections import OrderedDict, defaultdict | ||
22 | from bb.utils import vercmp_string | ||
21 | 23 | ||
22 | # Help us to find places to insert values | 24 | # Help us to find places to insert values |
23 | recipe_progression = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION', 'LICENSE', 'LICENSE_FLAGS', 'LIC_FILES_CHKSUM', 'PROVIDES', 'DEPENDS', 'PR', 'PV', 'SRCREV', 'SRCPV', 'SRC_URI', 'S', 'do_fetch()', 'do_unpack()', 'do_patch()', 'EXTRA_OECONF', 'EXTRA_OECMAKE', 'EXTRA_OESCONS', 'do_configure()', 'EXTRA_OEMAKE', 'do_compile()', 'do_install()', 'do_populate_sysroot()', 'INITSCRIPT', 'USERADD', 'GROUPADD', 'PACKAGES', 'FILES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RPROVIDES', 'RREPLACES', 'RCONFLICTS', 'ALLOW_EMPTY', 'populate_packages()', 'do_package()', 'do_deploy()'] | 25 | recipe_progression = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION', 'LICENSE', 'LICENSE_FLAGS', 'LIC_FILES_CHKSUM', 'PROVIDES', 'DEPENDS', 'PR', 'PV', 'SRCREV', 'SRCPV', 'SRC_URI', 'S', 'do_fetch()', 'do_unpack()', 'do_patch()', 'EXTRA_OECONF', 'EXTRA_OECMAKE', 'EXTRA_OESCONS', 'do_configure()', 'EXTRA_OEMAKE', 'do_compile()', 'do_install()', 'do_populate_sysroot()', 'INITSCRIPT', 'USERADD', 'GROUPADD', 'PACKAGES', 'FILES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RPROVIDES', 'RREPLACES', 'RCONFLICTS', 'ALLOW_EMPTY', 'populate_packages()', 'do_package()', 'do_deploy()'] |
@@ -1017,3 +1019,52 @@ def get_recipe_upstream_version(rd): | |||
1017 | ru['datetime'] = datetime.now() | 1019 | ru['datetime'] = datetime.now() |
1018 | 1020 | ||
1019 | return ru | 1021 | return ru |
1022 | |||
1023 | def get_recipe_upgrade_status(recipes=None): | ||
1024 | pkgs_list = [] | ||
1025 | with bb.tinfoil.Tinfoil() as tinfoil: | ||
1026 | tinfoil.prepare(config_only=False) | ||
1027 | |||
1028 | if not recipes: | ||
1029 | recipes = tinfoil.all_recipe_files(variants=False) | ||
1030 | |||
1031 | for fn in recipes: | ||
1032 | try: | ||
1033 | if fn.startswith("/"): | ||
1034 | data = tinfoil.parse_recipe_file(fn) | ||
1035 | else: | ||
1036 | data = tinfoil.parse_recipe(fn) | ||
1037 | except bb.providers.NoProvider: | ||
1038 | bb.note(" No provider for %s" % fn) | ||
1039 | continue | ||
1040 | |||
1041 | unreliable = data.getVar('UPSTREAM_CHECK_UNRELIABLE') | ||
1042 | if unreliable == "1": | ||
1043 | bb.note(" Skip package %s as upstream check unreliable" % pn) | ||
1044 | continue | ||
1045 | |||
1046 | uv = get_recipe_upstream_version(data) | ||
1047 | |||
1048 | pn = data.getVar('PN') | ||
1049 | cur_ver = uv['current_version'] | ||
1050 | |||
1051 | upstream_version_unknown = data.getVar('UPSTREAM_VERSION_UNKNOWN') | ||
1052 | if not uv['version']: | ||
1053 | status = "UNKNOWN" if upstream_version_unknown else "UNKNOWN_BROKEN" | ||
1054 | else: | ||
1055 | cmp = vercmp_string(uv['current_version'], uv['version']) | ||
1056 | if cmp == -1: | ||
1057 | status = "UPDATE" if not upstream_version_unknown else "KNOWN_BROKEN" | ||
1058 | elif cmp == 0: | ||
1059 | status = "MATCH" if not upstream_version_unknown else "KNOWN_BROKEN" | ||
1060 | else: | ||
1061 | status = "UNKNOWN" if upstream_version_unknown else "UNKNOWN_BROKEN" | ||
1062 | |||
1063 | next_ver = uv['version'] if uv['version'] else "N/A" | ||
1064 | revision = uv['revision'] if uv['revision'] else "N/A" | ||
1065 | maintainer = data.getVar('RECIPE_MAINTAINER') | ||
1066 | no_upgrade_reason = data.getVar('RECIPE_NO_UPDATE_REASON') | ||
1067 | |||
1068 | pkgs_list.append((pn, status, cur_ver, next_ver, maintainer, revision, no_upgrade_reason)) | ||
1069 | |||
1070 | return pkgs_list | ||