From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B5C79138334 for ; Sun, 20 Oct 2019 09:55:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E6F78E08F1; Sun, 20 Oct 2019 09:55:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CD5E5E08F1 for ; Sun, 20 Oct 2019 09:55:23 +0000 (UTC) Received: from localhost.localdomain (c134-66.icpnet.pl [85.221.134.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 5D7FE34C03A; Sun, 20 Oct 2019 09:55:22 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-portage-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-portage-dev] [PATCH] emirrordist: Report all stat() errors instead of first one Date: Sun, 20 Oct 2019 11:54:57 +0200 Message-Id: <20191020095457.376497-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.23.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 095f5287-dadb-44fe-a313-2c36d8555be8 X-Archives-Hash: a01c2f4f015547937e82c740fbfeef7a 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