Commit 29ed1f54 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Fix the crypto test shell wrapper and make it more robust

Correctly escape the variable in cmake, use kill -0 $_pid to wait for the
gpg-agent process to terminate instead of wait, because gpg-agent forks
itself, thus not being the child of the shell anymore.
parent dbefe8bd
...@@ -13,12 +13,14 @@ file(WRITE "${_filename}" ...@@ -13,12 +13,14 @@ file(WRITE "${_filename}"
${_library_path_variable}=${_ld_library_path}\${${_library_path_variable}:+:\$${_library_path_variable}} GNUPGHOME=${_gnupghome} gpg-agent --daemon \"${_executable}\" \"$@\" ${_library_path_variable}=${_ld_library_path}\${${_library_path_variable}:+:\$${_library_path_variable}} GNUPGHOME=${_gnupghome} gpg-agent --daemon \"${_executable}\" \"$@\"
_result=$? _result=$?
echo \"Waiting for gpg-agent to terminate...\" _pid=`echo GETINFO pid | GNUPGHOME=${_gnupghome} gpg-connect-agent | grep 'D' | cut -d' ' -f2`
pid=`echo GETINFO pid | GNUPGHOME=${_gnupghome} gpg-connect-agent | grep 'D' | cut -d' ' -f2` if [ ! -z \"\$_pid\" ]; then
if [ ! -z \"$pid\" ]; then echo \"Waiting for gpg-agent to terminate...\"
wait ${pid} while kill -0 \"\$_pid\"; do
sleep 1
done
fi fi
exit $_result exit \$_result
") ")
# make it executable # make it executable
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment