* [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/operations/, src/pkgcore/ebuild/
@ 2023-08-30 4:36 Arthur Zamarin
0 siblings, 0 replies; only message in thread
From: Arthur Zamarin @ 2023-08-30 4:36 UTC (permalink / raw
To: gentoo-commits
commit: 7f00362afff60e9cd635046b0da408a7e6f09ef0
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 30 04:35:54 2023 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Wed Aug 30 04:35:54 2023 +0000
URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=7f00362a
operations.format.fetch_base: try to use proxy values from domain
https://github.com/pkgcore/pkgcore/commit/b1053683ecb8e17ed69e5797c32b83dd48452f59#r125093286
Follows: 8d1a2095e9e3d5892d5eef39725d8bd2bcf74cbe
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
src/pkgcore/ebuild/domain.py | 9 +++++++--
src/pkgcore/operations/format.py | 4 ++--
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/pkgcore/ebuild/domain.py b/src/pkgcore/ebuild/domain.py
index 8d3f19662..1554f4240 100644
--- a/src/pkgcore/ebuild/domain.py
+++ b/src/pkgcore/ebuild/domain.py
@@ -315,7 +315,7 @@ class domain(config_domain):
# if unset, MAKEOPTS defaults to CPU thread count
if "MAKEOPTS" not in settings:
- settings["MAKEOPTS"] = "-j%i" % cpu_count()
+ settings["MAKEOPTS"] = f"-j{cpu_count()}"
# reformat env.d and make.conf incrementals
system_profile_settings = {}
@@ -356,7 +356,7 @@ class domain(config_domain):
if "ACCEPT_KEYWORDS" not in settings:
raise Failure(
- "No ACCEPT_KEYWORDS setting detected from profile, " "or user config"
+ "No ACCEPT_KEYWORDS setting detected from profile, or user config"
)
settings["ACCEPT_KEYWORDS"] = incremental_expansion(
settings["ACCEPT_KEYWORDS"], msg_prefix="while expanding ACCEPT_KEYWORDS"
@@ -367,6 +367,11 @@ class domain(config_domain):
return ImmutableDict(settings)
+ def get_settings_envvar(self, key: str, default=None):
+ if (val := self.settings.get(key)) is not None:
+ return val
+ return os.environ.get(key, default)
+
@property
def arch(self):
try:
diff --git a/src/pkgcore/operations/format.py b/src/pkgcore/operations/format.py
index d0cf6392b..fe56abee1 100644
--- a/src/pkgcore/operations/format.py
+++ b/src/pkgcore/operations/format.py
@@ -45,8 +45,8 @@ class fetch_base:
resumecmd,
attempts=attempts,
PATH=os.environ["PATH"],
- http_proxy=os.environ.get("http_proxy", ""),
- https_proxy=os.environ.get("https_proxy", ""),
+ http_proxy=domain.get_settings_envvar("http_proxy", ""),
+ https_proxy=domain.get_settings_envvar("https_proxy", ""),
)
def fetch_all(self, observer):
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-08-30 4:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-30 4:36 [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/operations/, src/pkgcore/ebuild/ Arthur Zamarin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox