commit: a6737b229d62ad08a2f133c718d22f8701ae7ecb Author: John Helmert III <ajak <AT> gentoo <DOT> org> AuthorDate: Thu Dec 1 17:43:19 2022 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sat Dec 3 01:38:23 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a6737b22
Manual string formatting updates Signed-off-by: John Helmert III <ajak <AT> gentoo.org> Closes: https://github.com/gentoo/portage/pull/888 Signed-off-by: Sam James <sam <AT> gentoo.org> lib/_emerge/actions.py | 5 +++-- lib/_emerge/depgraph.py | 13 +++++++------ lib/portage/update.py | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py index e93202b7f..30b687140 100644 --- a/lib/_emerge/actions.py +++ b/lib/_emerge/actions.py @@ -1651,8 +1651,9 @@ def _calc_depclean(settings, trees, ldpath_mtimes, myopts, action, args_set, spi if debug: writemsg_level( - "Candidates: [%s]\n" - % ", ".join("'{}'".format(x) for x in atoms), + "Candidates: [{}]\n".format( + ", ".join("'{}'".format(x) for x in atoms) + ), noiselevel=-1, level=logging.DEBUG, ) diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 3b7c0d431..6b08f9fe2 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -2039,12 +2039,13 @@ class depgraph: "", "", "backtracking due to slot conflict:", - " first package: %s" % existing_node, - " package(s) to mask: %s" % str(to_be_masked), - " slot: %s" % slot_atom, - " parents: %s" - % ", ".join( - "({}, '{}')".format(ppkg, atom) for ppkg, atom in all_parents + " first package: {}".format(existing_node), + " package(s) to mask: {}".format(str(to_be_masked)), + " slot: {}".format(slot_atom), + " parents: {}".format( + ", ".join( + "({}, '{}')".format(ppkg, atom) for ppkg, atom in all_parents + ) ), "", ] diff --git a/lib/portage/update.py b/lib/portage/update.py index fdd0b1948..64dfad7e9 100644 --- a/lib/portage/update.py +++ b/lib/portage/update.py @@ -424,8 +424,8 @@ def update_config_files( if match_callback(repo_name, atom, new_atom): # add a comment with the update command, so # the user can clearly see what happened - contents[pos] = "# %s\n" % " ".join( - "{}".format(x) for x in update_cmd + contents[pos] = "# {}\n".format( + " ".join("{}".format(x) for x in update_cmd) ) contents.insert( pos + 1,
