[PATCH 2/2] test: use gpgconf --create-socketdir if available

Tomi Ollila tomi.ollila at iki.fi
Sun Feb 19 02:24:43 PST 2017


On Tue, Feb 14 2017, David Bremner <david at tethera.net> wrote:

> This enables the shortened socket pathes in /run or equivalent. The
> explicit call to gpgconf is needed for nonstandard GNUPGHOME settings.

2½ comments inline:

__> ---
>  test/test-lib.sh | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/test/test-lib.sh b/test/test-lib.sh
> index 86e792a8..9aa6163b 100644
> --- a/test/test-lib.sh
> +++ b/test/test-lib.sh
> @@ -229,9 +229,18 @@ test_fixed=0
>  test_broken=0
>  test_success=0
>  
> +
> +_shutdown_gpg_agent () {
> +    if [ ${NOTMUCH_HAVE_GPGCONF_SOCKETDIR} == 1 ]; then

 '==' is bashishm (well, maybe works in zsh too), standard
with [ ... ] and (builtin) test(1) is just single '=' for equality.

> +	gpgconf --kill gpg-agent
> +	gpgconf --remove-socketdir
> +    fi
> +}
> +
>  _exit_common () {
>  	code=$?
>  	trap - EXIT
> +	_shutdown_gpg_agent

better put `set +ex` _before_ `_shutdown_gpg_agent` so that possible failure
there may not stop exit processing

>  	set +ex
>  	rm -rf "$TEST_TMPDIR"
>  }
> @@ -1276,6 +1285,11 @@ test_init_ () {
>  
>  . ./test-lib-common.sh || exit 1
>  
> +# we need the setting of GNUPGHOME in test-lib-common.sh
> +if [ ${NOTMUCH_HAVE_GPGCONF_SOCKETDIR} == 1 ]; then

== -> = 

> +    gpgconf --create-socketdir
> +fi
> +
>  emacs_generate_script
>  
>  
> -- 
> 2.11.0
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list