Re: [PATCH util-modular v2] release.sh: unset GPGKEY if already existing

2017-04-20 Thread Peter Hutterer
On Thu, Apr 20, 2017 at 08:18:45AM +0300, Andres Gomez wrote:
> On Thu, 2017-04-20 at 10:17 +1000, Peter Hutterer wrote:
> > On Wed, Apr 19, 2017 at 03:59:33PM +0300, Andres Gomez wrote:
> > > GPGKEY may already exist in the environment. In that case, just
> > > unset it.
> > > 
> > > v2: unsetting is safer than redefining to quietly use a potentially
> > > wrong key stored in the variable (Peter).
> > > 
> > > Signed-off-by: Andres Gomez 
> > > Cc: Emil Velikov 
> > > Cc: Peter Hutterer 
> > > ---
> > >  release.sh | 5 +
> > >  1 file changed, 5 insertions(+)
> > > 
> > > diff --git a/release.sh b/release.sh
> > > index f976f94..b8a0aaf 100755
> > > --- a/release.sh
> > > +++ b/release.sh
> > > @@ -808,6 +808,11 @@ if [ "x$GPG" = "x" ] ; then
> > >  fi
> > >  fi
> > >  
> > > +# Unset GPGKEY if needed
> > > +if [ ! -z ${GPGKEY+x} ] ; then
> > > +unset GPGKEY
> > > +fi
> > 
> > wouldn't that fail if GPGKEY is set to the empty string? Plus, I had to look
> > up what ${foo+x} actually does :) Should we just stick to the simple well
> > known:
> > 
> > if [ "x$GPGKEY" != "x" ] ; then
> > unset GPGKEY
> > fi
> 
> ${foo+x} actually ensures it. That solution always unsets if the
> variable is set, empty string or not.

ok, that's good enough for me then, thanks, but...

> I suppose this other version would work too but, then, we will have a
> different outcome if GPGKEY is set with or without an empty string. In
> that case I would go for an even simpler initialization:
> 
> GPGKEY="" 
> 
> That way you ensure that GPGKEY is always set to an empty string.
> 
> Let me know what you prefer.

.. let's do the unconditional unset please, it's the most expressive one
and skips the extra checks. sorry about the churn.

Cheers,
   Peter
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH util-modular v2] release.sh: unset GPGKEY if already existing

2017-04-19 Thread Andres Gomez
On Thu, 2017-04-20 at 08:18 +0300, Andres Gomez wrote:
...
> 
I suppose this other version would work too but, then, we will have a
> different outcome if GPGKEY is set with or without an empty string. In
> that case I would go for an even simpler initialization:
> 
> GPGKEY="" 

Or, simply:

unset GPGKEY

-- 
Br,

Andres
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH util-modular v2] release.sh: unset GPGKEY if already existing

2017-04-19 Thread Andres Gomez
On Thu, 2017-04-20 at 10:17 +1000, Peter Hutterer wrote:
> On Wed, Apr 19, 2017 at 03:59:33PM +0300, Andres Gomez wrote:
> > GPGKEY may already exist in the environment. In that case, just
> > unset it.
> > 
> > v2: unsetting is safer than redefining to quietly use a potentially
> > wrong key stored in the variable (Peter).
> > 
> > Signed-off-by: Andres Gomez 
> > Cc: Emil Velikov 
> > Cc: Peter Hutterer 
> > ---
> >  release.sh | 5 +
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/release.sh b/release.sh
> > index f976f94..b8a0aaf 100755
> > --- a/release.sh
> > +++ b/release.sh
> > @@ -808,6 +808,11 @@ if [ "x$GPG" = "x" ] ; then
> >  fi
> >  fi
> >  
> > +# Unset GPGKEY if needed
> > +if [ ! -z ${GPGKEY+x} ] ; then
> > +unset GPGKEY
> > +fi
> 
> wouldn't that fail if GPGKEY is set to the empty string? Plus, I had to look
> up what ${foo+x} actually does :) Should we just stick to the simple well
> known:
> 
> if [ "x$GPGKEY" != "x" ] ; then
> unset GPGKEY
> fi

${foo+x} actually ensures it. That solution always unsets if the
variable is set, empty string or not.

I suppose this other version would work too but, then, we will have a
different outcome if GPGKEY is set with or without an empty string. In
that case I would go for an even simpler initialization:

GPGKEY="" 

That way you ensure that GPGKEY is always set to an empty string.

Let me know what you prefer.

-- 
Br,

Andres
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH util-modular v2] release.sh: unset GPGKEY if already existing

2017-04-19 Thread Peter Hutterer
On Wed, Apr 19, 2017 at 03:59:33PM +0300, Andres Gomez wrote:
> GPGKEY may already exist in the environment. In that case, just
> unset it.
> 
> v2: unsetting is safer than redefining to quietly use a potentially
> wrong key stored in the variable (Peter).
> 
> Signed-off-by: Andres Gomez 
> Cc: Emil Velikov 
> Cc: Peter Hutterer 
> ---
>  release.sh | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/release.sh b/release.sh
> index f976f94..b8a0aaf 100755
> --- a/release.sh
> +++ b/release.sh
> @@ -808,6 +808,11 @@ if [ "x$GPG" = "x" ] ; then
>  fi
>  fi
>  
> +# Unset GPGKEY if needed
> +if [ ! -z ${GPGKEY+x} ] ; then
> +unset GPGKEY
> +fi

wouldn't that fail if GPGKEY is set to the empty string? Plus, I had to look
up what ${foo+x} actually does :) Should we just stick to the simple well
known:

if [ "x$GPGKEY" != "x" ] ; then
unset GPGKEY
fi

Cheers,
   Peter

> +
>  # Set the default make tarball creation command
>  MAKE_DIST_CMD=distcheck
>  
> -- 
> 2.11.0
> 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH util-modular v2] release.sh: unset GPGKEY if already existing

2017-04-19 Thread Emil Velikov
On 19 April 2017 at 13:59, Andres Gomez  wrote:
> GPGKEY may already exist in the environment. In that case, just
> unset it.
>
> v2: unsetting is safer than redefining to quietly use a potentially
> wrong key stored in the variable (Peter).
>
> Signed-off-by: Andres Gomez 
> Cc: Emil Velikov 
> Cc: Peter Hutterer 
Either solution is fine with me.

Reviewed-by: Emil Velikov 

Thanks
Emil
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH util-modular v2] release.sh: unset GPGKEY if already existing

2017-04-19 Thread Andres Gomez
GPGKEY may already exist in the environment. In that case, just
unset it.

v2: unsetting is safer than redefining to quietly use a potentially
wrong key stored in the variable (Peter).

Signed-off-by: Andres Gomez 
Cc: Emil Velikov 
Cc: Peter Hutterer 
---
 release.sh | 5 +
 1 file changed, 5 insertions(+)

diff --git a/release.sh b/release.sh
index f976f94..b8a0aaf 100755
--- a/release.sh
+++ b/release.sh
@@ -808,6 +808,11 @@ if [ "x$GPG" = "x" ] ; then
 fi
 fi
 
+# Unset GPGKEY if needed
+if [ ! -z ${GPGKEY+x} ] ; then
+unset GPGKEY
+fi
+
 # Set the default make tarball creation command
 MAKE_DIST_CMD=distcheck
 
-- 
2.11.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel