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 AFC891382C5 for ; Mon, 24 May 2021 04:55:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F356CE0845; Mon, 24 May 2021 04:55:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 DD763E0845 for ; Mon, 24 May 2021 04:55:37 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5AF95335D6E for ; Mon, 24 May 2021 04:55:36 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B8938632 for ; Mon, 24 May 2021 04:55:34 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1621831221.09d783eb12ed1f93550d86f1ee2437012ffc7cc2.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/update.py X-VCS-Directories: lib/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 09d783eb12ed1f93550d86f1ee2437012ffc7cc2 X-VCS-Branch: master Date: Mon, 24 May 2021 04:55:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b5d68bc6-3dd5-4d05-abe4-fb69e21d6f99 X-Archives-Hash: 14d6b71e428b617710b96abc23a9cdfd commit: 09d783eb12ed1f93550d86f1ee2437012ffc7cc2 Author: Michał Górny gentoo org> AuthorDate: Wed May 12 16:10:10 2021 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon May 24 04:40:21 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=09d783eb Relax update filenames as permitted for EAPI 8 Bug: https://bugs.gentoo.org/692774 Signed-off-by: Michał Górny gentoo.org> Signed-off-by: Zac Medico gentoo.org> lib/portage/update.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/portage/update.py b/lib/portage/update.py index f11b14217..67d3c08b0 100644 --- a/lib/portage/update.py +++ b/lib/portage/update.py @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 import errno @@ -175,21 +175,16 @@ def grab_updates(updpath, prev_mtimes=None): raise if prev_mtimes is None: prev_mtimes = {} - # validate the file name (filter out CVS directory, etc...) - mylist = [myfile for myfile in mylist if len(myfile) == 7 and myfile[1:3] == "Q-"] - if len(mylist) == 0: - return [] - - # sort by (year, quarter) - mylist.sort(key=lambda x: (x[3:], x[:2])) update_data = [] for myfile in mylist: + if myfile.startswith("."): + continue file_path = os.path.join(updpath, myfile) mystat = os.stat(file_path) - if update_data or \ - file_path not in prev_mtimes or \ - int(prev_mtimes[file_path]) != mystat[stat.ST_MTIME]: + if not stat.S_ISREG(mystat.st_mode): + continue + if int(prev_mtimes.get(file_path, -1)) != mystat[stat.ST_MTIME]: f = io.open(_unicode_encode(file_path, encoding=_encodings['fs'], errors='strict'), mode='r', encoding=_encodings['repo.content'], errors='replace')