Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/
Date: Sun, 27 Mar 2022 23:07:18
Message-Id: 1648422404.6e316a87828069f19906c5dace6f5215154b52b4.sam@gentoo
1 commit: 6e316a87828069f19906c5dace6f5215154b52b4
2 Author: Kenneth Raplee <kenrap <AT> kennethraplee <DOT> com>
3 AuthorDate: Tue Mar 22 07:56:35 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 27 23:06:44 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=6e316a87
7
8 Use str.join() instead of string concatenation
9
10 Joining strings is also faster.
11
12 Signed-off-by: Kenneth Raplee <kenrap <AT> kennethraplee.com>
13 Signed-off-by: Sam James <sam <AT> gentoo.org>
14
15 lib/portage/_global_updates.py | 27 ++++++++++++---------------
16 1 file changed, 12 insertions(+), 15 deletions(-)
17
18 diff --git a/lib/portage/_global_updates.py b/lib/portage/_global_updates.py
19 index a17ee861d..d7117d36b 100644
20 --- a/lib/portage/_global_updates.py
21 +++ b/lib/portage/_global_updates.py
22 @@ -97,21 +97,18 @@ def _do_global_updates(trees, prev_mtimes, quiet=False, if_mtime_changed=True):
23 )
24 if not quiet:
25 writemsg_stdout(
26 - _(
27 - " %s='update pass' %s='binary update' "
28 - "%s='/var/db update' %s='/var/db move'\n"
29 - " %s='/var/db SLOT move' %s='binary move' "
30 - "%s='binary SLOT move'\n %s='update /etc/portage/package.*'\n"
31 - )
32 - % (
33 - bold("."),
34 - bold("*"),
35 - bold("#"),
36 - bold("@"),
37 - bold("s"),
38 - bold("%"),
39 - bold("S"),
40 - bold("p"),
41 + " ".join(
42 + (
43 + "",
44 + f"{bold('.')}='update pass'",
45 + f"{bold('*')}='binary update'",
46 + f"{bold('#')}='/var/db update'",
47 + f"{bold('@')}='/var/db move'\n",
48 + f"{bold('s')}='/var/db SLOT move'",
49 + f"{bold('%')}='binary move'"
50 + f"{bold('S')}='binary SLOT move'\n",
51 + f"{bold('p')}='update /etc/portage/package.*'\n",
52 + )
53 )
54 )
55 valid_updates, errors = parse_updates(mycontent)