Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* Re: [sup-devel] sup dies when gpgme not present
@ 2011-01-27 12:02 Hamish D
  2011-01-27 13:26 ` Alvaro Herrera
  0 siblings, 1 reply; 2+ messages in thread
From: Hamish D @ 2011-01-27 12:02 UTC (permalink / raw)
  To: Sup developer discussion

>> I have some more ideas for improvements, but I'm happy that this
>> reproduces the behaviour of using the gpg binary, and I find sup usage
>> much smoother with this change.

Thank you.

> When the gpgme gem is not installed, this patch makes sup die on start
> with:
>
> --- NameError from thread: main
> uninitialized constant Redwood::CryptoManager::GPGME
> /home/alvherre/Code/sup-mail/lib/sup/crypto.rb:49:in `initialize'
> ...

The code around that line is:

    # test if the gpgme gem is available
    @gpgme_present =
      begin
        begin
          GPGME.check_version({:protocol => GPGME::PROTOCOL_OpenPGP})
     <-- line 49
          true
        rescue GPGME::Error
          false
        end
      rescue NameError
        false
      end

So we should rescue the NameError. Could you check whether the code
for your sup looks like that? Could you also temporarily remove the
gpgme gem, update to the latest from master and see if you still get
the same problem?

Thanks in advance, and sorry for not getting back sooner.
Hamish
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [sup-devel] sup dies when gpgme not present
  2011-01-27 12:02 [sup-devel] sup dies when gpgme not present Hamish D
@ 2011-01-27 13:26 ` Alvaro Herrera
  0 siblings, 0 replies; 2+ messages in thread
From: Alvaro Herrera @ 2011-01-27 13:26 UTC (permalink / raw)
  To: sup-devel

Excerpts from Hamish D's message of jue ene 27 09:02:51 -0300 2011:

> > When the gpgme gem is not installed, this patch makes sup die on start
> > with:
> >
> > --- NameError from thread: main
> > uninitialized constant Redwood::CryptoManager::GPGME
> > /home/alvherre/Code/sup-mail/lib/sup/crypto.rb:49:in `initialize'
> > ...
> 
> The code around that line is:
> 
>     # test if the gpgme gem is available
>     @gpgme_present =
>       begin
>         begin
>           GPGME.check_version({:protocol => GPGME::PROTOCOL_OpenPGP})
>      <-- line 49
>           true
>         rescue GPGME::Error
>           false
>         end
>       rescue NameError
>         false
>       end
> 
> So we should rescue the NameError. Could you check whether the code
> for your sup looks like that?

It doesn't.  The code I had failing was:

 45     # test if the gpgme gem is available
 46     @gpgme_present = true
 47     begin
 48     GPGME.check_version({:protocol => GPGME::PROTOCOL_OpenPGP})
 49     rescue NameError, GPGME::Error
 50       @gpgme_present = false
 51       return
 52     end


> Could you also temporarily remove the gpgme gem, update to the latest
> from master and see if you still get the same problem?

I have just updated to master and now the code looks like the snippet
you pasted.  This was fixed in:

commit 02fbc3c8bb5e82a3ea67c2dd239bc3ccca36049e
Author: William Morgan <william@twitter.com>
Date:   Wed Jan 19 15:47:28 2011 -0800

    fix gpgme check
    
    It works as is in 1.9, but in 1.8 it was throwing an exception for even
    referencing GPGME::Error if gpgme wasn't installed.


I tried uninstalling gpgme and now it starts without dying.

-- 
Álvaro Herrera -- Se vende casa en Ñuñoa: www.portalinmobiliario.com/993147
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-27 13:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-27 12:02 [sup-devel] sup dies when gpgme not present Hamish D
2011-01-27 13:26 ` Alvaro Herrera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox