From f7dbebcc2c974866a57f2e8d8b01979daa6062da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= Date: Mon, 20 Dec 2021 17:49:25 +0100 Subject: [PATCH] fix(exec): add --quiet to systemd-run (#1654) * add --quiet to systemd-run this will avoid the `Press ^] three times within 1s to disconnect TTY.` message. it's mentioned in the systemd-run man page too: ``` --quiet, -q Suppresses additional informational output while running. This is particularly useful in combination with --pty when it will suppress the initial message explaining how to terminate the TTY connection. ``` * add --quiet to the tests * add --quiet to TestABSPKGBUILDRepoExistsPerms too --- pkg/download/abs_test.go | 4 ++-- pkg/download/aur_test.go | 4 ++-- pkg/settings/exe/cmd_builder.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/download/abs_test.go b/pkg/download/abs_test.go index 7ba48704..a9cea475 100644 --- a/pkg/download/abs_test.go +++ b/pkg/download/abs_test.go @@ -206,7 +206,7 @@ func TestABSPKGBUILDRepo(t *testing.T) { if path, _ := exec.LookPath(ld); path != "" { ld = path } - want = fmt.Sprintf("%s --service-type=oneshot --pipe --wait --pty -p DynamicUser=yes -p CacheDirectory=yay -E HOME=/tmp --no-replace-objects -C /tmp/doesnt-exist clone --no-progress --single-branch -b packages/linux https://github.com/archlinux/svntogit-packages.git linux", ld) + want = fmt.Sprintf("%s --service-type=oneshot --pipe --wait --pty --quiet -p DynamicUser=yes -p CacheDirectory=yay -E HOME=/tmp --no-replace-objects -C /tmp/doesnt-exist clone --no-progress --single-branch -b packages/linux https://github.com/archlinux/svntogit-packages.git linux", ld) } cmdBuilder := &testGitBuilder{ @@ -240,7 +240,7 @@ func TestABSPKGBUILDRepoExistsPerms(t *testing.T) { if path, _ := exec.LookPath(ld); path != "" { ld = path } - want = fmt.Sprintf("%s --service-type=oneshot --pipe --wait --pty -p DynamicUser=yes -p CacheDirectory=yay -E HOME=/tmp --no-replace-objects -C %s/linux pull --rebase --autostash", ld, dir) + want = fmt.Sprintf("%s --service-type=oneshot --pipe --wait --pty --quiet -p DynamicUser=yes -p CacheDirectory=yay -E HOME=/tmp --no-replace-objects -C %s/linux pull --rebase --autostash", ld, dir) } cmdRunner := &testRunner{} diff --git a/pkg/download/aur_test.go b/pkg/download/aur_test.go index 2bc42eee..2d2bebdd 100644 --- a/pkg/download/aur_test.go +++ b/pkg/download/aur_test.go @@ -84,7 +84,7 @@ func TestAURPKGBUILDRepo(t *testing.T) { if path, _ := exec.LookPath(ld); path != "" { ld = path } - want = fmt.Sprintf("%s --service-type=oneshot --pipe --wait --pty -p DynamicUser=yes -p CacheDirectory=yay -E HOME=/tmp --no-replace-objects -C /tmp/doesnt-exist clone --no-progress https://aur.archlinux.org/yay-bin.git yay-bin", ld) + want = fmt.Sprintf("%s --service-type=oneshot --pipe --wait --pty --quiet -p DynamicUser=yes -p CacheDirectory=yay -E HOME=/tmp --no-replace-objects -C /tmp/doesnt-exist clone --no-progress https://aur.archlinux.org/yay-bin.git yay-bin", ld) } cmdRunner := &testRunner{} @@ -119,7 +119,7 @@ func TestAURPKGBUILDRepoExistsPerms(t *testing.T) { if path, _ := exec.LookPath(ld); path != "" { ld = path } - want = fmt.Sprintf("%s --service-type=oneshot --pipe --wait --pty -p DynamicUser=yes -p CacheDirectory=yay -E HOME=/tmp --no-replace-objects -C %s/yay-bin pull --rebase --autostash", ld, dir) + want = fmt.Sprintf("%s --service-type=oneshot --pipe --wait --pty --quiet -p DynamicUser=yes -p CacheDirectory=yay -E HOME=/tmp --no-replace-objects -C %s/yay-bin pull --rebase --autostash", ld, dir) } cmdRunner := &testRunner{} diff --git a/pkg/settings/exe/cmd_builder.go b/pkg/settings/exe/cmd_builder.go index d31c4109..8c0a0ebd 100644 --- a/pkg/settings/exe/cmd_builder.go +++ b/pkg/settings/exe/cmd_builder.go @@ -123,7 +123,7 @@ func (c *CmdBuilder) deElevateCommand(ctx context.Context, cmd *exec.Cmd) *exec. cmdArgs := []string{ "--service-type=oneshot", - "--pipe", "--wait", "--pty", + "--pipe", "--wait", "--pty", "--quiet", "-p", "DynamicUser=yes", "-p", "CacheDirectory=yay", "-E", "HOME=/tmp",