[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sup-devel] [PATCH v2] prefer gpg2 (GnuPG 2.x) over gpg (GnuPG 1.x)



Excerpts from Sascha Silbe's message of Die Jan 11 19:59:43 +0100 2011:
> Since 1.9.14 GnuPG can automatically start gpg-agent if it's not already
> running (using a well-known socket location). When using GnuPG 1.x gpg-agent
> needs to already be running at the time sup is started because the socket
> location is random and passed via environment variables.
> 
> Autostarting gpg-agent is particularly convenient when using sup via ssh
> as gpg-agent would need to be started manually (for local X sessions OTOH
> it's often started automatically by distro scripts).

AFAICS this change is not compatible with the rework of the GPG
handling done in the gpgme branch. I was under the impression (from
previous discussion on this list) that this branch is going to be
merged soon (at least into next).

Gaudenz

> 
> Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
> ---
>  lib/sup/crypto.rb |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> v1->v2:
>   fallback to gpg if gpg2 is not available
> 
> diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
> index 537745d..16ebaf9 100644
> --- a/lib/sup/crypto.rb
> +++ b/lib/sup/crypto.rb
> @@ -25,9 +25,10 @@ EOS
>    def initialize
>      @mutex = Mutex.new
> 
> -    bin = `which gpg`.chomp
> -    @cmd = case bin
> -    when /\S/
> +    @cmd = if (bin = `which gpg2`.chomp) =~ /\S/
> +      debug "crypto: detected gpg binary in #{bin}"
> +      "#{bin} --quiet --batch --no-verbose --logger-fd 1 --use-agent"
> +    elsif (bin = `which gpg`.chomp) =~ /\S/
>        debug "crypto: detected gpg binary in #{bin}"
>        "#{bin} --quiet --batch --no-verbose --logger-fd 1 --use-agent"
>      else
-- 
Ever tried. Ever failed. No matter.
Try again. Fail again. Fail better.
~ Samuel Beckett ~

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel