commit:     542222ac998b655bcea7e491465e7df7f5e74591
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 16 16:43:33 2023 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat Sep 16 17:05:51 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=542222ac

fetch: ignore force-mirror feature when try_mirrors is false

When fetching layout.conf, we call fetch(try_mirrors=False) to force
direct use of the primary URI being passed and ignore mirrors.

The force-mirror feature causes fetch to ignore the primary URI.

Ignoring both the primary URI and mirrors leads to an unfetchable file.
Give precedence to the try_mirrors parameter since we really only set it
to False when fetching layout.conf from a mirror.

Bug: https://bugs.gentoo.org/877793
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 NEWS                                | 2 ++
 lib/portage/package/ebuild/fetch.py | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 023bea3f85..63e365e683 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,8 @@ Bug fixes:
 
 * vartree: keep build dir if postinst fails (bug #704866).
 
+* fetch: fix fetching of layout.conf when FEATURES=force-mirror (bug #877793).
+
 portage-3.0.51 (2023-08-20)
 --------------
 

diff --git a/lib/portage/package/ebuild/fetch.py 
b/lib/portage/package/ebuild/fetch.py
index 0ecad162e5..59a0afcf63 100644
--- a/lib/portage/package/ebuild/fetch.py
+++ b/lib/portage/package/ebuild/fetch.py
@@ -980,7 +980,7 @@ def fetch(
     ]
 
     restrict_fetch = "fetch" in restrict
-    force_mirror = "force-mirror" in features and not restrict_mirror
+    force_mirror = "force-mirror" in features and not restrict_mirror and 
try_mirrors
 
     file_uri_tuples = []
     # Check for 'items' attribute since OrderedDict is not a dict.

Reply via email to