From 16c10cc913a1320a38854dddc652f38d24f2e291 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 9 Jun 2022 10:02:44 +0200 Subject: [PATCH] DeviceShell: Don't use 'command' to test for base64 On (debian based) linux the "command -v base64" did fail to find the base64 exectuable. Instead we now use "which". Change-Id: I9b57527d93952b08bcb9abc7484a7e6891aa664c Reviewed-by: Christian Stenger --- src/libs/utils/deviceshell.cpp | 6 +++--- tests/auto/utils/deviceshell/tst_deviceshell.cpp | 2 +- tests/manual/deviceshell/tst_deviceshell.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/utils/deviceshell.cpp b/src/libs/utils/deviceshell.cpp index a4e0bf13c8d..807ac2c4bd5 100644 --- a/src/libs/utils/deviceshell.cpp +++ b/src/libs/utils/deviceshell.cpp @@ -53,7 +53,7 @@ namespace { * Once the process exits its exit code is send to stdout with the command-id and the type "R". * */ -const QLatin1String r_execScript = QLatin1String(R"( +const QLatin1String r_execScript = QLatin1String(R"SCRIPT( #!/bin/sh readAndMark() { @@ -133,7 +133,7 @@ cleanup() exit 1 } -if ! command -v base64 &> /dev/null +if [ -z "$(which base64)" ] then echo "base64 command could not be found" >&2 exit 1 @@ -149,7 +149,7 @@ while read -r id inData cmd; do fi execute $id $inData $cmd & done -)"); +)SCRIPT"); } // namespace diff --git a/tests/auto/utils/deviceshell/tst_deviceshell.cpp b/tests/auto/utils/deviceshell/tst_deviceshell.cpp index 40181b7d25e..8c68650504b 100644 --- a/tests/auto/utils/deviceshell/tst_deviceshell.cpp +++ b/tests/auto/utils/deviceshell/tst_deviceshell.cpp @@ -279,6 +279,6 @@ private slots: } }; -QTEST_MAIN(tst_DeviceShell) +QTEST_GUILESS_MAIN(tst_DeviceShell) #include "tst_deviceshell.moc" diff --git a/tests/manual/deviceshell/tst_deviceshell.cpp b/tests/manual/deviceshell/tst_deviceshell.cpp index f9ab9b4e8a3..df3e28dab9f 100644 --- a/tests/manual/deviceshell/tst_deviceshell.cpp +++ b/tests/manual/deviceshell/tst_deviceshell.cpp @@ -223,6 +223,6 @@ private slots: } }; -QTEST_MAIN(tst_DeviceShell) +QTEST_GUILESS_MAIN(tst_DeviceShell) #include "tst_deviceshell.moc"