c72f3f2b43
The check_package_get_latest_version_by_distro() function analyzes the data returned by release-monitoring.org. For two of our packages (bento4 and qextserialport), release-monitoring.org returns something that is a bit odd: it returns an entry with a "stable_versions" field that contains an empty array. Our code was ready to have or not have a "stable_versions" entry, but when it is present, we assumed it was not an empty array. These two packages, for some reason, break this assumption. In order to solve this problem, this commit is more careful, and uses the stable_versions field only if it exists and it has at least one entry. The code is also reworked as a sequence of "if...elif...else" to be more readable. This fixes the following exception when running pkg-stats on the full package set: Task exception was never retrieved future: <Task finished name='Task-10772' coro=<check_package_latest_version_get() done, defined at ./support/scripts/pkg-stats:532> exception=IndexError('list index out of range')> Traceback (most recent call last): File "./support/scripts/pkg-stats", line 535, in check_package_latest_version_get if await check_package_get_latest_version_by_distro(session, pkg): File "./support/scripts/pkg-stats", line 489, in check_package_get_latest_version_by_distro version = data['stable_versions'][0] if 'stable_versions' in data else data['version'] if 'version' in data else None IndexError: list index out of range Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> [yann.morin.1998@free.fr: non-sequence tests as True] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> |
||
---|---|---|
.. | ||
config-fragments | ||
dependencies | ||
docker | ||
download | ||
gnuconfig | ||
kconfig | ||
legal-info | ||
libtool | ||
misc | ||
scripts | ||
testing |