* [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/operations/
@ 2022-10-16 19:10 Arthur Zamarin
0 siblings, 0 replies; 3+ messages in thread
From: Arthur Zamarin @ 2022-10-16 19:10 UTC (permalink / raw
To: gentoo-commits
commit: a189abfaca3603bf1c298e92eb755c117e0e7fa2
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 16 19:04:32 2022 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 16 19:10:33 2022 +0000
URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=a189abfa
operations.fetch: better error messages when fetching fails
Improve the error messages when we have fetch failures. Till now we were
always outputting the first version of the package in error, and weren't
listing which distfiles failed. Now we output all failures separately,
use a special FetchError exception class, and output unversioned atom in
final error message.
Resolves: https://github.com/pkgcore/pkgdev/issues/86
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
src/pkgcore/operations/format.py | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/pkgcore/operations/format.py b/src/pkgcore/operations/format.py
index cdb16fdc0..d66eaf192 100644
--- a/src/pkgcore/operations/format.py
+++ b/src/pkgcore/operations/format.py
@@ -4,7 +4,7 @@ build operation
__all__ = (
'build_base', 'install', 'uninstall', 'replace', 'fetch_base',
- 'empty_build_op', 'FailedDirectory', 'GenericBuildError',
+ 'empty_build_op', 'FailedDirectory', 'GenericBuildError', 'FetchError',
)
import os
@@ -133,8 +133,10 @@ class operations(_operations_mod.base):
build_ops = self.domain.build_pkg(pkgwrap, observer, failed=True)
build_ops.nofetch()
build_ops.cleanup(force=True)
- observer.error('failed fetching files: %s::%s', self.pkg.cpvstr, self.pkg.repo.repo_id)
- raise GenericBuildError('failed fetching required distfiles')
+ for fetchable in failures:
+ observer.error('failed fetching %s', fetchable.uri)
+ observer.error('failed fetching files for package %s::%s', self.pkg.unversioned_atom, self.pkg.repo.repo_id)
+ raise FetchError(failures)
self.verified_files = verified
return True
@@ -335,3 +337,9 @@ class GenericBuildError(BuildError):
def __init__(self, err):
super().__init__(f"failed build operation: {err}")
self.err = str(err)
+
+
+class FetchError(BuildError):
+ def __init__(self, failures):
+ super().__init__("failed fetching required distfiles")
+ self.err = str(failures)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/operations/
@ 2023-07-26 12:02 Arthur Zamarin
0 siblings, 0 replies; 3+ messages in thread
From: Arthur Zamarin @ 2023-07-26 12:02 UTC (permalink / raw
To: gentoo-commits
commit: 15550ad9c486e23894773de505a12af4f7eba887
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 26 12:00:54 2023 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Wed Jul 26 12:00:54 2023 +0000
URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=15550ad9
pass PATH variable to calls of FETCHCOMMAND
Resolves: https://github.com/pkgcore/pkgdev/issues/145
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
src/pkgcore/operations/format.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/pkgcore/operations/format.py b/src/pkgcore/operations/format.py
index 22b975b46..00746c4a8 100644
--- a/src/pkgcore/operations/format.py
+++ b/src/pkgcore/operations/format.py
@@ -40,7 +40,11 @@ class fetch_base:
resumecmd = domain.settings.get("RESUMECOMMAND", fetchcmd)
attempts = int(domain.settings.get("FETCH_ATTEMPTS", 10))
self.fetcher = fetch_custom.fetcher(
- self.distdir, fetchcmd, resumecmd, attempts=attempts
+ self.distdir,
+ fetchcmd,
+ resumecmd,
+ attempts=attempts,
+ PATH=os.environ["PATH"],
)
def fetch_all(self, observer):
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/operations/
@ 2023-08-21 18:24 Arthur Zamarin
0 siblings, 0 replies; 3+ messages in thread
From: Arthur Zamarin @ 2023-08-21 18:24 UTC (permalink / raw
To: gentoo-commits
commit: 8d1a2095e9e3d5892d5eef39725d8bd2bcf74cbe
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 21 18:23:37 2023 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 21 18:23:37 2023 +0000
URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=8d1a2095
operations.format.fetch_base: fix for when no proxy
Follows: b1053683ecb8e17ed69e5797c32b83dd48452f59
Resolves: https://github.com/pkgcore/pkgdev/issues/151
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
src/pkgcore/operations/format.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pkgcore/operations/format.py b/src/pkgcore/operations/format.py
index 95775f7b0..d0cf6392b 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["http_proxy"],
- https_proxy=os.environ["https_proxy"],
+ http_proxy=os.environ.get("http_proxy", ""),
+ https_proxy=os.environ.get("https_proxy", ""),
)
def fetch_all(self, observer):
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-21 18:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-26 12:02 [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/operations/ Arthur Zamarin
-- strict thread matches above, loose matches on Subject: below --
2023-08-21 18:24 Arthur Zamarin
2022-10-16 19:10 Arthur Zamarin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox