commit:     851115b8128d2e7279a4a05ebfbf741f945ef24d
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 24 13:40:34 2025 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Oct 24 13:40:34 2025 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=851115b8

Avoid a command substitution in news module

* modules/news.eselect (do_list): Call printf instead of space.

Bug: https://bugs.gentoo.org/965038#c7
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ChangeLog            | 2 ++
 modules/news.eselect | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index aa94856..c40f4bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2025-10-24  Ulrich Müller  <[email protected]>
 
+       * modules/news.eselect (do_list): Call printf instead of space.
+
        * libs/output.bash.in (space): Don't loop.
 
        * libs/output.bash.in (apply_text_highlights): Modify the "text"

diff --git a/modules/news.eselect b/modules/news.eselect
index 5125431..08e3320 100644
--- a/modules/news.eselect
+++ b/modules/news.eselect
@@ -1,5 +1,5 @@
 # -*-eselect-*-  vim: ft=eselect
-# Copyright 2005-2021 Gentoo Authors
+# Copyright 2005-2025 Gentoo Authors
 # Distributed under the terms of the GNU GPL version 2 or later
 
 inherit package-manager
@@ -220,7 +220,7 @@ do_list() {
                        title="(${item} - removed?)"
                fi
                [[ ${repo} != gentoo ]] && title="[${repo}] ${title}"
-               line="${posted}$(space $((10 - ${#posted})))  ${title}"
+               printf -v line "%-10s  %s" "${posted}" "${title}"
                # truncate the line if it is too long
                (( 11 + ${#line} >= cols && cols >= 72 )) \
                        && line="${line:0:cols-15}..."

Reply via email to