public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/equery/
Date: Sun, 10 Jul 2022 16:23:14 +0000 (UTC)	[thread overview]
Message-ID: <1657468525.c1c66b84d3e14b887b7b460111664e62238172fb.dolsen@gentoo> (raw)

commit:     c1c66b84d3e14b887b7b460111664e62238172fb
Author:     Alexander Miller <alex.miller <AT> gmx <DOT> de>
AuthorDate: Sun Jul 10 15:55:25 2022 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Jul 10 15:55:25 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=c1c66b84

equery check: Fix exception handling for Insufficient permissions

A quick look into the source reveals that there is actually code to handle the case,
but it expects the wrong exception type.
This patch fixes that and also avoids a crash for other errors.

Bug: https://bugs.gentoo.org/494134
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/gentoolkit/equery/check.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pym/gentoolkit/equery/check.py b/pym/gentoolkit/equery/check.py
index 7a7c3db..7e580b1 100644
--- a/pym/gentoolkit/equery/check.py
+++ b/pym/gentoolkit/equery/check.py
@@ -16,6 +16,7 @@ from functools import partial
 from getopt import gnu_getopt, GetoptError
 
 import portage.checksum as checksum
+from portage.exception import PermissionDenied
 
 import gentoolkit.pprinter as pp
 from gentoolkit import errors
@@ -138,10 +139,14 @@ class VerifyContents:
             md5sum = files[cfile][2]
             try:
                 cur_checksum = checksum.perform_md5(real_cfile, calc_prelink=1)
-            except IOError:
+            except PermissionDenied:
                 err = "Insufficient permissions to read %(cfile)s"
                 obj_errs.append(err % locals())
                 return obj_errs
+            except Exception as ex:
+                err = "Problem checking %(cfile)s: %(ex)s"
+                obj_errs.append(err % locals())
+                return obj_errs
             if cur_checksum != md5sum:
                 err = "%(cfile)s has incorrect MD5sum"
                 obj_errs.append(err % locals())


             reply	other threads:[~2022-07-10 16:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-10 16:23 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-07 18:49 [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/equery/ Sam James
2024-03-07 18:49 Sam James
2023-09-19 19:13 Sam James
2023-08-05  5:38 Sam James
2023-07-18 22:30 Sam James
2023-07-18 22:26 Sam James
2022-07-28 15:29 Brian Dolbec
2022-07-28 15:29 Brian Dolbec
2022-07-10 18:41 Brian Dolbec
2022-07-10 18:01 Brian Dolbec
2022-07-10 16:23 Brian Dolbec
2022-07-10  1:24 Brian Dolbec
2022-07-09  5:17 Sam James
2018-05-01 12:32 Mike Pagano
2017-09-05 15:32 Mike Gilbert
2016-06-30 23:36 Paul Varner
2016-06-30 20:44 Paul Varner
2016-06-06 19:29 Brian Dolbec
2015-11-09 20:52 Brian Dolbec
2015-11-09  2:42 Brian Dolbec
2015-11-08 17:37 Brian Dolbec

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=1657468525.c1c66b84d3e14b887b7b460111664e62238172fb.dolsen@gentoo \
    --to=dolsen@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox