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 <christian.stenger@qt.io>
This commit is contained in:
Marcus Tillmanns
2022-06-09 10:02:44 +02:00
parent 1cf9d06675
commit 16c10cc913
3 changed files with 5 additions and 5 deletions

View File

@@ -53,7 +53,7 @@ namespace {
* Once the process exits its exit code is send to stdout with the command-id and the type "R". * 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 #!/bin/sh
readAndMark() { readAndMark() {
@@ -133,7 +133,7 @@ cleanup()
exit 1 exit 1
} }
if ! command -v base64 &> /dev/null if [ -z "$(which base64)" ]
then then
echo "base64 command could not be found" >&2 echo "base64 command could not be found" >&2
exit 1 exit 1
@@ -149,7 +149,7 @@ while read -r id inData cmd; do
fi fi
execute $id $inData $cmd & execute $id $inData $cmd &
done done
)"); )SCRIPT");
} // namespace } // namespace

View File

@@ -279,6 +279,6 @@ private slots:
} }
}; };
QTEST_MAIN(tst_DeviceShell) QTEST_GUILESS_MAIN(tst_DeviceShell)
#include "tst_deviceshell.moc" #include "tst_deviceshell.moc"

View File

@@ -223,6 +223,6 @@ private slots:
} }
}; };
QTEST_MAIN(tst_DeviceShell) QTEST_GUILESS_MAIN(tst_DeviceShell)
#include "tst_deviceshell.moc" #include "tst_deviceshell.moc"