From 42b3735e2f1f685dda18352e09a24db4b0b4bc15 Mon Sep 17 00:00:00 2001
From: dd
Date: Fri, 9 Aug 2024 08:16:55 +0200
Subject: fixed build iso argument escaping
---
auto/helper-logic | 4 ++--
build-iso.sh | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/auto/helper-logic b/auto/helper-logic
index 200098d..b82c1d3 100644
--- a/auto/helper-logic
+++ b/auto/helper-logic
@@ -180,7 +180,7 @@ function Run {
function RunWithLazyStdout {
set -e
- command=$1
+ command="$1"
# stop the background command on ctrl+c
# and cleanup temporary file and tail on exit
@@ -210,7 +210,7 @@ function RunWithLazyStdout {
buffer=$(mktemp -p /tmp --suffix=-background-buffer)
- $command > $buffer &
+ eval "$command" > $buffer &
pid=$!
echo "Show output? Press y..."
diff --git a/build-iso.sh b/build-iso.sh
index eb5cbb6..7e11afd 100755
--- a/build-iso.sh
+++ b/build-iso.sh
@@ -89,7 +89,6 @@ function GetLatestTag {
customPackages="vyos-1x-smoketest"
customPackages=${CUSTOM_PACKAGES:-$customPackages}
-echo "Using CUSTOM_PACKAGES=$customPackages"
echo "Building the ISO..."
if [ "$BRANCH" == "equuleus" ]; then
@@ -97,6 +96,7 @@ if [ "$BRANCH" == "equuleus" ]; then
RELEASE_NAME="$LATEST-release-$DATE"
function DockerBuild {
+ echo "Using arguments: --build-by '$1' --version '$2' --custom-package '$3'"
docker run --rm --privileged -v ./vyos-build/:/vyos -v "/tmp/apt.gpg.key:/opt/apt.gpg.key" -w /vyos --sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=$(id -u) -e GOSU_GID=$(id -g) -w /vyos vyos/vyos-build:equuleus \
sudo ./configure \
--architecture amd64 \
@@ -116,6 +116,7 @@ elif [ "$BRANCH" == "sagitta" ]; then
RELEASE_NAME="$LATEST-release-$DATE"
function DockerBuild {
+ echo "Using arguments: --build-by '$1' --version '$2' --custom-package '$3'"
docker run --rm --privileged --name="vyos-build" -v ./vyos-build/:/vyos -v "/tmp/apt.gpg.key:/opt/apt.gpg.key" -w /vyos --sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=$(id -u) -e GOSU_GID=$(id -g) -w /vyos vyos/vyos-build:sagitta \
sudo --preserve-env ./build-vyos-image iso \
--architecture amd64 \
@@ -132,8 +133,9 @@ else
exit 1
fi
-dockerBuild="DockerBuild $BUILD_BY $RELEASE_NAME $customPackages"
+dockerBuild="DockerBuild \"$BUILD_BY\" \"$RELEASE_NAME\" \"$customPackages\""
if ! IsFlagSet "-v" "$@"; then
+ dockerBuild=${dockerBuild//\"/\\\"} # escape double quotes with backslash
dockerBuild="RunWithLazyStdout \"$dockerBuild\""
fi
--
cgit v1.2.3