Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/repository/, /
Date: Sun, 19 Mar 2023 19:14:38
Message-Id: 1679253269.08cdac85ffaf9b9915c40d9ffcd0ed3cf0e434d3.sam@gentoo
1 commit: 08cdac85ffaf9b9915c40d9ffcd0ed3cf0e434d3
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Fri Mar 10 14:56:04 2023 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 19 19:14:29 2023 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=08cdac85
7
8 repository: config: absorb all exceptions when determining volatility
9
10 Not ideal, but we don't have much else of a choice. It's a very
11 small section and trying to granularly specify the relevant exceptions
12 here is clearly a waste of time (see ref'd bugs).
13
14 Besides, the consequence is just failing-safe and assuming the repo
15 is volatile anyway.
16
17 Bug: https://bugs.gentoo.org/899208
18 Bug: https://bugs.gentoo.org/900683
19 Signed-off-by: Sam James <sam <AT> gentoo.org>
20 Closes: https://github.com/gentoo/portage/pull/1005
21 Signed-off-by: Sam James <sam <AT> gentoo.org>
22
23 NEWS | 12 ++++++++++--
24 lib/portage/repository/config.py | 9 ++++++++-
25 2 files changed, 18 insertions(+), 3 deletions(-)
26
27 diff --git a/NEWS b/NEWS
28 index a6daf1138..88296f690 100644
29 --- a/NEWS
30 +++ b/NEWS
31 @@ -1,15 +1,23 @@
32 +portage-3.0.45.3 (UNRELEASED)
33 +----------------
34 +
35 +Features:
36 * New portage FEATURE warn-on-large-env, to emit a warning if portage
37 executes an ebuild-related child process with a large environment.
38
39 +Bug fixes:
40 +* repository: config: Handle more error cases when determining repository
41 + volatility (bug #900683).
42 +
43 portage-3.0.45.2 (2023-03-04)
44 ---------------
45 +----------------
46
47 Bug fixes:
48 * repository: config: Fix initial sync of repositories (bug #899208). Regression
49 from portage-3.0.45, but the real bug is from portage-3.0.42.
50
51 portage-3.0.45.1 (2023-02-27)
52 ---------------
53 +----------------
54
55 Bug fixes:
56 * install-qa-check.d/90config-impl-decl: fix handling of non-ASCII quotes when
57
58 diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
59 index 3d887ffaa..a01320fd7 100644
60 --- a/lib/portage/repository/config.py
61 +++ b/lib/portage/repository/config.py
62 @@ -361,7 +361,14 @@ class RepoConfig:
63 self.volatile = True
64 else:
65 self.volatile = False
66 - except (FileNotFoundError, PermissionError):
67 + except Exception:
68 + # There's too many conditions here to refine the exception list:
69 + # - We lack permissions to poke at the directory (PermissionError)
70 + # - Its UID doesn't actually exist and the repository
71 + # won't be synced by the user (KeyError).
72 + # - The directory doesn't exist (FileNotFoundError)
73 + # - Probably many others.
74 + # So, just fail safe.
75 self.volatile = True
76
77 self.eapi = None