All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 1/9] support/script/pkg-stat: Handle exception when version comparison fails
Date: Sun, 12 Jul 2020 21:32:56 +0200	[thread overview]
Message-ID: <20200712213256.25a68573@windsurf.home> (raw)
In-Reply-To: <20200710112245.1044073-12-gregory.clement@bootlin.com>

Hello,

On Fri, 10 Jul 2020 13:22:37 +0200
Gregory CLEMENT <gregory.clement@bootlin.com> wrote:

> With python 3, when a package has a version number x-y-z instead of
> x.y.z, then the version returned by LooseVersion can't be compared
> which raises an exception.
> 
> This patch handles this exception by adding a new return value when
> the comparison can't be done. As a third value has been introduce, the
> booelan are no more used.
> 
> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>

Typos in the commit title:

	support/scripts/pkg-stats

also, we generally don't use a capital letter to start the short
description.

> +                    try:
> +                        affected = pkg_version <= cve_affected_version
> +                        break
> +                    except:

This kind of "catch all exceptions" is not recommended in Python, and
flake8 is not happy about it, so I changed it to:

			except TypeError:

I fixed up this issue, the commit log issue, and applied. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2020-07-12 19:32 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 11:22 [Buildroot] [PATCH 0/9] Improving CVE reporting Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH 1/9] support/scripts: Turn CVE check into a module Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH 2/9] support/scripts/cve.py: Switch to JSON 1.1 Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH 3/9] package/pkg-utils: show-info: report the list of the CVEs ignored Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH 4/9] package/pkg-utils: Make CVE class independent of the Pacakage class Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH 5/9] support/scripts: Add a per configuration CVE checker Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH 6/9] package/pkg-utils: cve.py: Handle exception when version comparison fails Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH 7/9] support/script/pkg-stats: Manage the CVEs that need to be check Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH 8/9] support/script/cve-checker: " Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH 9/9] package/pkg-utils/cve.py: Manage case when package version doesn't exist Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH v2 0/9] Improving CVE reporting Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH v2 1/9] support/script/pkg-stat: Handle exception when version comparison fails Gregory CLEMENT
2020-07-12 19:32   ` Thomas Petazzoni [this message]
2020-07-10 11:22 ` [Buildroot] [PATCH v2 2/9] support/scripts: Turn CVE check into a module Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH v2 3/9] support/scripts/cve.py: Switch to JSON 1.1 Gregory CLEMENT
2020-07-12 19:44   ` Titouan Christophe
2020-07-23 12:23     ` Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH v2 4/9] package/pkg-utils: show-info: report the list of the CVEs ignored Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH v2 5/9] support/script: Make CVE class independent of the Pacakage class Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH v2 6/9] support/scripts: Add a per configuration CVE checker Gregory CLEMENT
2020-07-10 12:41   ` Matthew Weber
2020-07-10 11:22 ` [Buildroot] [PATCH v2 7/9] support/script/pkg-stats: Manage the CVEs that need to be check Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH v2 8/9] support/script/cve-checker: " Gregory CLEMENT
2020-07-10 11:22 ` [Buildroot] [PATCH v2 9/9] package/pkg-utils/cve.py: Manage case when package version doesn't exist Gregory CLEMENT

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200712213256.25a68573@windsurf.home \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.