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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D5EE015808B for ; Sun, 27 Mar 2022 23:07:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BA27FE0986; Sun, 27 Mar 2022 23:07:15 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 374B2E0978 for ; Sun, 27 Mar 2022 23:07:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C123E3436B2 for ; Sun, 27 Mar 2022 23:07:13 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9A12334D for ; Sun, 27 Mar 2022 23:07:10 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1648422404.6e316a87828069f19906c5dace6f5215154b52b4.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/_global_updates.py X-VCS-Directories: lib/portage/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 6e316a87828069f19906c5dace6f5215154b52b4 X-VCS-Branch: master Date: Sun, 27 Mar 2022 23:07:10 +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: e222a2e9-90b7-4a19-8a82-38d3039f5628 X-Archives-Hash: a73467ff9b5f4dd399403f51c37fc2b6 commit: 6e316a87828069f19906c5dace6f5215154b52b4 Author: Kenneth Raplee kennethraplee com> AuthorDate: Tue Mar 22 07:56:35 2022 +0000 Commit: Sam James gentoo org> CommitDate: Sun Mar 27 23:06:44 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=6e316a87 Use str.join() instead of string concatenation Joining strings is also faster. Signed-off-by: Kenneth Raplee kennethraplee.com> Signed-off-by: Sam James gentoo.org> lib/portage/_global_updates.py | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/lib/portage/_global_updates.py b/lib/portage/_global_updates.py index a17ee861d..d7117d36b 100644 --- a/lib/portage/_global_updates.py +++ b/lib/portage/_global_updates.py @@ -97,21 +97,18 @@ def _do_global_updates(trees, prev_mtimes, quiet=False, if_mtime_changed=True): ) if not quiet: writemsg_stdout( - _( - " %s='update pass' %s='binary update' " - "%s='/var/db update' %s='/var/db move'\n" - " %s='/var/db SLOT move' %s='binary move' " - "%s='binary SLOT move'\n %s='update /etc/portage/package.*'\n" - ) - % ( - bold("."), - bold("*"), - bold("#"), - bold("@"), - bold("s"), - bold("%"), - bold("S"), - bold("p"), + " ".join( + ( + "", + f"{bold('.')}='update pass'", + f"{bold('*')}='binary update'", + f"{bold('#')}='/var/db update'", + f"{bold('@')}='/var/db move'\n", + f"{bold('s')}='/var/db SLOT move'", + f"{bold('%')}='binary move'" + f"{bold('S')}='binary SLOT move'\n", + f"{bold('p')}='update /etc/portage/package.*'\n", + ) ) ) valid_updates, errors = parse_updates(mycontent)