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}"
${_library_path_variable}=${_ld_library_path}\${${_library_path_variable}:+:\$${_library_path_variable}} GNUPGHOME=${_gnupghome} gpg-agent --daemon \"${_executable}\" \"$@\"
_result=$?
echo \"Waiting for gpg-agent to terminate...\"
pid=`echo GETINFO pid | GNUPGHOME=${_gnupghome} gpg-connect-agent | grep 'D' | cut -d' ' -f2`
if [ ! -z \"$pid\" ]; then
wait ${pid}
_pid=`echo GETINFO pid | GNUPGHOME=${_gnupghome} gpg-connect-agent | grep 'D' | cut -d' ' -f2`
if [ ! -z \"\$_pid\" ]; then
echo \"Waiting for gpg-agent to terminate...\"
while kill -0 \"\$_pid\"; do
sleep 1
done
fi
exit $_result
exit \$_result
")
# 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