public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Arthur Zamarin" <arthurzam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/operations/, src/pkgcore/ebuild/
Date: Wed, 30 Aug 2023 04:36:53 +0000 (UTC)	[thread overview]
Message-ID: <1693370154.7f00362afff60e9cd635046b0da408a7e6f09ef0.arthurzam@gentoo> (raw)

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):


                 reply	other threads:[~2023-08-30  4:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1693370154.7f00362afff60e9cd635046b0da408a7e6f09ef0.arthurzam@gentoo \
    --to=arthurzam@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