public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* [gentoo-portage-dev] [PATCH] emirrordist: Report all stat() errors instead of first one
@ 2019-10-20  9:54 99% Michał Górny
  0 siblings, 0 replies; 1+ results
From: Michał Górny @ 2019-10-20  9:54 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

When DeletionIterator fails, report all stat() errors.  Reporting
just the first one results in confusing logs, suggesting that one
of the location did not exist but the other existed and was removed.
---
 lib/portage/_emirrordist/DeletionIterator.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/portage/_emirrordist/DeletionIterator.py b/lib/portage/_emirrordist/DeletionIterator.py
index cd773b3c8..dab6eaea2 100644
--- a/lib/portage/_emirrordist/DeletionIterator.py
+++ b/lib/portage/_emirrordist/DeletionIterator.py
@@ -25,20 +25,20 @@ class DeletionIterator(object):
 			distfiles_set.update(layout.get_filenames(distdir))
 		for filename in distfiles_set:
 			# require at least one successful stat()
-			first_exception = None
+			exceptions = []
 			for layout in reversed(self._config.layouts):
 				try:
 					st = os.stat(
 							os.path.join(distdir, layout.get_path(filename)))
 				except OSError as e:
-					first_exception = e
+					exceptions.append(e)
 				else:
 					if stat.S_ISREG(st.st_mode):
 						break
 			else:
-				if first_exception is not None:
+				if exceptions:
 					logging.error("stat failed on '%s' in distfiles: %s\n" %
-						(filename, first_exception))
+						(filename, '; '.join(str(x) for x in exceptions)))
 				continue
 
 			if filename in file_owners:
-- 
2.23.0



^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-10-20  9:54 99% [gentoo-portage-dev] [PATCH] emirrordist: Report all stat() errors instead of first one Michał Górny

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