public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: lib/portage/repository/, /
@ 2020-08-05  3:15 Zac Medico
  0 siblings, 0 replies; 3+ messages in thread
From: Zac Medico @ 2020-08-05  3:15 UTC (permalink / raw
  To: gentoo-commits

commit:     3e0063094ce656a173f46a9a4837260322769f2e
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  5 02:35:51 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug  5 03:09:38 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=3e006309

lib/portage/repository/config.py: fix trailing-comma-tuple

* This fixes the one instance of trailing-comma-tuple in the repo
* A tuple does need created, but lets do so inside of parentheses as
  expected

Suggested-By: Sam James <sam <AT> gentoo.org>
Suggested-By: Zac Medico <zmedico <AT> gentoo.org>
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/repository/config.py | 2 +-
 pylintrc                         | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
index 0f3e582f8..f7c956dd8 100644
--- a/lib/portage/repository/config.py
+++ b/lib/portage/repository/config.py
@@ -871,7 +871,7 @@ class RepoConfigLoader:
 				continue
 			if repo.masters is None:
 				if self.mainRepo() and repo_name != self.mainRepo().name:
-					repo.masters = self.mainRepo(),
+					repo.masters = (self.mainRepo(),)
 				else:
 					repo.masters = ()
 			else:

diff --git a/pylintrc b/pylintrc
index cdfd48653..b7091516c 100644
--- a/pylintrc
+++ b/pylintrc
@@ -22,6 +22,7 @@ enable=
         redefined-builtin,
         reimported,
         relative-beyond-top-level,
+        trailing-comma-tuple,
         trailing-newlines,
         trailing-whitespace,
         unexpected-line-ending-format,


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/repository/, /
@ 2023-03-19 19:14 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2023-03-19 19:14 UTC (permalink / raw
  To: gentoo-commits

commit:     08cdac85ffaf9b9915c40d9ffcd0ed3cf0e434d3
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 10 14:56:04 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar 19 19:14:29 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=08cdac85

repository: config: absorb all exceptions when determining volatility

Not ideal, but we don't have much else of a choice. It's a very
small section and trying to granularly specify the relevant exceptions
here is clearly a waste of time (see ref'd bugs).

Besides, the consequence is just failing-safe and assuming the repo
is volatile anyway.

Bug: https://bugs.gentoo.org/899208
Bug: https://bugs.gentoo.org/900683
Signed-off-by: Sam James <sam <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1005
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                             | 12 ++++++++++--
 lib/portage/repository/config.py |  9 ++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index a6daf1138..88296f690 100644
--- a/NEWS
+++ b/NEWS
@@ -1,15 +1,23 @@
+portage-3.0.45.3 (UNRELEASED)
+----------------
+
+Features:
 * New portage FEATURE warn-on-large-env, to emit a warning if portage
   executes an ebuild-related child process with a large environment.
 
+Bug fixes:
+* repository: config: Handle more error cases when determining repository
+  volatility (bug #900683).
+
 portage-3.0.45.2 (2023-03-04)
---------------
+----------------
 
 Bug fixes:
 * repository: config: Fix initial sync of repositories (bug #899208). Regression
   from portage-3.0.45, but the real bug is from portage-3.0.42.
 
 portage-3.0.45.1 (2023-02-27)
---------------
+----------------
 
 Bug fixes:
 * install-qa-check.d/90config-impl-decl: fix handling of non-ASCII quotes when

diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
index 3d887ffaa..a01320fd7 100644
--- a/lib/portage/repository/config.py
+++ b/lib/portage/repository/config.py
@@ -361,7 +361,14 @@ class RepoConfig:
                     self.volatile = True
                 else:
                     self.volatile = False
-            except (FileNotFoundError, PermissionError):
+            except Exception:
+                # There's too many conditions here to refine the exception list:
+                # - We lack permissions to poke at the directory (PermissionError)
+                # - Its UID doesn't actually exist and the repository
+                #   won't be synced by the user (KeyError).
+                # - The directory doesn't exist (FileNotFoundError)
+                # - Probably many others.
+                # So, just fail safe.
                 self.volatile = True
 
         self.eapi = None


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/repository/, /
@ 2024-07-10 16:55 James Le Cuirot
  0 siblings, 0 replies; 3+ messages in thread
From: James Le Cuirot @ 2024-07-10 16:55 UTC (permalink / raw
  To: gentoo-commits

commit:     ea04a583fab9739dbe05e8d8381ed2803e7dce88
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  9 13:07:58 2024 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Wed Jul 10 16:55:20 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ea04a583

config: Allow a repository to be configured using one of its aliases

Currently, the `[name]` in repos.conf can only match the primary name.
This is inconvenient if a repository wants to change its name without
breaking existing configurations.

This raises the question of whether to then use the primary name or the
alias in the UI and in the vardb. I went with the primary name because
this is presumably the name that the repository actually wants you to
use.

If the configured name matches neither the primary name nor an alias,
then emaint sync will simply claim that it is not found, but that
behaviour is unchanged from before.

Bug: https://bugs.gentoo.org/935830
Closes: https://github.com/gentoo/portage/pull/1358
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 NEWS                             |  3 +++
 lib/portage/repository/config.py | 10 ++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index d5a03533d9..53ba9f5fb1 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,9 @@ Bug fixes:
 
 * vartree, movefile: Warn when rewriting a symlink (bug #934514).
 
+* repository: config: Allow a repository to be configured using one of its
+  aliases rather than its primary name (bug #935830).
+
 portage-3.0.65 (2024-06-04)
 --------------
 

diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
index c9dfffa22c..46a2d83856 100644
--- a/lib/portage/repository/config.py
+++ b/lib/portage/repository/config.py
@@ -943,7 +943,9 @@ class RepoConfigLoader:
                         del prepos[repo_name]
                         continue
 
-                    if repo.name != repo_name:
+                    if repo.name != repo_name and (
+                        repo.aliases is None or repo_name not in repo.aliases
+                    ):
                         writemsg_level(
                             "!!! %s\n"
                             % _(
@@ -957,13 +959,13 @@ class RepoConfigLoader:
                         del prepos[repo_name]
                         continue
 
-                location_map[repo.location] = repo_name
-                treemap[repo_name] = repo.location
+                location_map[repo.location] = repo.name
+                treemap[repo.name] = repo.location
 
         # Add alias mappings, but never replace unaliased mappings.
         for repo_name, repo in list(prepos.items()):
             names = set()
-            names.add(repo_name)
+            names.add(repo.name)
             if repo.aliases:
                 aliases = stack_lists([repo.aliases], incremental=True)
                 names.update(aliases)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-10 16:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-10 16:55 [gentoo-commits] proj/portage:master commit in: lib/portage/repository/, / James Le Cuirot
  -- strict thread matches above, loose matches on Subject: below --
2023-03-19 19:14 Sam James
2020-08-05  3:15 Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox