# Invoking gpg-agent with no arguments exits successfully if the agent
# is already running as pointed by $GPG_AGENT_INFO
if ! $GPGAGENT 2>/dev/null; then STARTUP="$GPGAGENT --daemon --sh --write-env-file=$PID_FILE $STARTUP"
fi
That's why we need to export GPG_AGENT_INFO; otherwise, the code doesn't even do what it says it does.
A snippet from 90gpg-agent reads like this.
# Invoking gpg-agent with no arguments exits successfully if the agent
STARTUP= "$GPGAGENT --daemon --sh --write- env-file= $PID_FILE $STARTUP"
# is already running as pointed by $GPG_AGENT_INFO
if ! $GPGAGENT 2>/dev/null; then
fi
That's why we need to export GPG_AGENT_INFO; otherwise, the code doesn't even do what it says it does.