It tries to exit gpg-agent. Path to the communication socket is derived from homedir. The gpg-agent automaticaly removes all its socket before exit.
Newer gpg-agent creates sockets under [/var]/run/user/{pid}/... if directory exists. In this case gpg-agent will not be exited.
It solves the https://bugzilla.redhat.com/show_bug.cgi?id=1650266 issue of remaining sockets in the gpg home directory.
This PR replaces another solution https://github.com/rpm-software-management/librepo/pull/152 that configures the gpg agent to run in server mode (without sockets). Importing of repo keys was very slow with gpg-agent in server mode during the unit tests.
It tries to exit gpg-agent. Path to the communication socket is derived from homedir. The gpg-agent automaticaly removes all its socket before exit. Newer gpg-agent creates sockets under [/var]/run/user/{pid}/... if directory exists. In this case gpg-agent will not be exited. It solves the https://bugzilla.redhat.com/show_bug.cgi?id=1650266 issue of remaining sockets in the gpg home directory.
This PR replaces another solution https://github.com/rpm-software-management/librepo/pull/152 that configures the gpg agent to run in server mode (without sockets). Importing of repo keys was very slow with gpg-agent in server mode during the unit tests.