From 43662e757d82d526490b46816d93ecb5ae6144dd Mon Sep 17 00:00:00 2001 From: Sander Pikhoff Date: Thu, 24 Feb 2022 17:59:59 +0200 Subject: [PATCH] Fix unterminated quoted string error when running podman v4 Release candidates of podman v4 are unable to handle escape sequences inside strings. See: https://github.com/containers/podman/issues/13446 Work around this by using the println function instead. --- code.sh | 2 +- tests/test-basic.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code.sh b/code.sh index 390c651..b9d7085 100755 --- a/code.sh +++ b/code.sh @@ -298,7 +298,7 @@ fi # different toolboxes step on each other. homevar="$(flatpak-spawn --host podman inspect "$container_name" \ - --format='{{ range .Config.Env }}{{ . }}{{"\n"}}{{ end }}' \ + --format='{{ range .Config.Env }}{{ println . }}{{ end }}' \ | grep ^HOME=)" homevar="${homevar#HOME=}" diff --git a/tests/test-basic.sh b/tests/test-basic.sh index 5d5deb1..92894bc 100644 --- a/tests/test-basic.sh +++ b/tests/test-basic.sh @@ -11,7 +11,7 @@ test_basic() { assert_contents /logs/basic.cmd <<'EOF' flatpak list --app --columns=application -podman inspect toolbox-vscode-test --format={{ range .Config.Env }}{{ . }}{{"\n"}}{{ end }} +podman inspect toolbox-vscode-test --format={{ range .Config.Env }}{{ println . }}{{ end }} flatpak ps --columns=instance,application,pid flatpak run com.visualstudio.code --remote attached-container+746f6f6c626f782d7673636f64652d74657374 /home/testuser/project EOF @@ -66,7 +66,7 @@ test_installation() { flatpak list --app --columns=application flatpak remotes --columns=name flatpak install flathub com.visualstudio.code -podman inspect toolbox-vscode-test --format={{ range .Config.Env }}{{ . }}{{"\n"}}{{ end }} +podman inspect toolbox-vscode-test --format={{ range .Config.Env }}{{ println . }}{{ end }} flatpak ps --columns=instance,application,pid flatpak run com.visualstudio.code --remote attached-container+746f6f6c626f782d7673636f64652d74657374 /home/testuser/project EOF @@ -98,7 +98,7 @@ test_running() { assert_contents /logs/running.cmd <<'EOF' flatpak list --app --columns=application -podman inspect toolbox-vscode-test --format={{ range .Config.Env }}{{ . }}{{"\n"}}{{ end }} +podman inspect toolbox-vscode-test --format={{ range .Config.Env }}{{ println . }}{{ end }} flatpak ps --columns=instance,application,pid flatpak enter 123456 sh -c cd $0