From 1d9568b669cf72906701aef650b113efe95d2396 Mon Sep 17 00:00:00 2001
From: Sertonix <sertonix@posteo.net>
Date: Thu, 10 Oct 2024 14:40:30 +0200
Subject: [PATCH] abuild: fix eval argument splitting and simplify

A newline starts a new command in shell scripts and eval uses the shell
grammar. Use a space instead to fix multiline repo templates.

Also avoid one subshell.
---
 abuild.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/abuild.in b/abuild.in
index 6dba0c5e..047c6656 100644
--- a/abuild.in
+++ b/abuild.in
@@ -2366,9 +2366,9 @@ apk_add_makedeps() {
 	shift
 
 	repo_args="--repository $(shell_escape "$REPODEST/$repo")"
-	[ -s "$repo_template" ] && repo_args=$(while read r; do
-		printf %s\\n "--repository $(shell_escape "$REPODEST/${r##*/}")"
-	done) < "$repo_template"
+	[ -s "$repo_template" ] && while read r; do
+		repo_args="$repo_args --repository $(shell_escape "$REPODEST/${r##*/}")"
+	done < "$repo_template"
 
 	eval "$SUDO_APK" add "$apk_opt_wait" "$repo_args" \
 		--virtual .${prefix}depends-$pkgname "\$@" || return
-- 
GitLab