support/scripts/pkg-stats: use the new 'stable_versions' field of release-monitoring.org
The pkg-stats script queries release-monitoring.org to find the latest upstream versions of our packages. However, up until recently, release-monitoring.org had no notion of stable vs. development/release-candidate versions, so for some packages the "latest" version was in fact a development/release-candidate version that we didn't want to package in Buildroot. However, in recent time, release-monitoring.org has gained support for differentiating stable vs. development releases of upstream projects. See for example https://release-monitoring.org/project/10024/ for the glib library, which has a number of versions marked "Pre-release". The JSON blurb returned by release-monitoring.org has 3 relevant fields: - "version", which we are using currently, which is a string containing the reference of the latest version, including pre-release. - "versions", which is an array of strings listing all versions, pre-release or not. - "stable_versions", which is an array of string listing only non-pre-release versions. It is ordered newest first to oldest last. So, this commit changes from using 'version' to using 'stable_versions[0]'. As an example, before this change, pkg-stats reports that nfs-utils needs to be bumped to 2.5.5rc3, while after this patch, it reports that nfs-utils is already at 2.5.4, and that this is the latest stable version (modulo an issue where Buildroot has 2.5.4 and release-monitoring.org has 2-5-4, this will be addressed separately). Note that part of this change was already done in commitf7b0e0860
, but it was incomplete. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> (cherry picked from commit11efcb39b2
) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
23017276cc
commit
f3cce2e3d2
@ -507,13 +507,13 @@ async def check_package_get_latest_version_by_guess(session, pkg, retry=True):
|
||||
|
||||
data = await resp.json()
|
||||
# filter projects that have the right name and a version defined
|
||||
projects = [p for p in data['projects'] if p['name'] == pkg.name and 'version' in p]
|
||||
projects = [p for p in data['projects'] if p['name'] == pkg.name and 'stable_versions' in p]
|
||||
projects.sort(key=lambda x: x['id'])
|
||||
|
||||
if len(projects) > 0:
|
||||
check_package_latest_version_set_status(pkg,
|
||||
RM_API_STATUS_FOUND_BY_PATTERN,
|
||||
projects[0]['version'],
|
||||
projects[0]['stable_versions'][0],
|
||||
projects[0]['id'])
|
||||
return True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user