commit:     7a03e610d63b42ca42c05135427d807e76b21f01
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sun Jul 20 06:01:02 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jul 22 22:30:53 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7a03e610

isolated-functions.sh: specify the -r option to read in __repo_attr()

Presently, the __repo_attr() function acts as a crude parser for the
value of the 'PORTAGE_REPOSITORIES' variable, which contains the
contents of files beneath the "/etc/portage/repos.conf" directory. It
makes 'PORTAGE_REPOSITORIES' the subject of a herestring, and uses the
read builtin to obtain each embedded line. However, if fails to specify
the -r option. Have it do so, duly rectifying an instance of SC2162.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/isolated-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 54b86687a5..e1e0bc10be 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -540,7 +540,7 @@ has() {
 __repo_attr() {
        local appropriate_section=0 exit_status=1 line 
saved_extglob_shopt=$(shopt -p extglob)
        shopt -s extglob
-       while read line; do
+       while read -r line; do
                [[ ${appropriate_section} == 0 && ${line} == "[$1]" ]] && 
appropriate_section=1 && continue
                [[ ${appropriate_section} == 1 && ${line} == "["*"]" ]] && 
appropriate_section=0 && continue
                # If a conditional expression like [[ ${line} == $2*( )=* ]] is 
used

Reply via email to