Need to distinguish between g10_log_info and g10_log_error

Oleg V. Zhylin ovz at yahoo.com
Fri Sep 26 03:06:30 CEST 2008


  Yes, you're right. Up to recently I've used $LASTEXITCODE to check for errors. $LASTEXITCODE and $? are two quite related ones

http://blogs.msdn.com/powershell/archive/2006/09/15/ErrorLevel-equivalent.aspx

  As far as gpg concerned looks like it doesn't affect $LASTEXITCODE at all. I suspect this is because Powershell doesn't treat it as win32 executable. But $? works just fine, thanks.

  BTW I had to overcome another problem before my script started functioning as it is suppsed to. The error message

gpg: Can't check signature: public key not found
gpg: WARNING: message was not integrity protected

 stably renders $?=False and I couldn't find any command-line settings to amend this. In my current situation I do have public key of the sender, it is just not at default $GNUPGHOME. But potentially one can run into situation when he doesn't have author's public key and its impossible to retrieve one. Still, decrypting a file means "success" for this person.

WBR Oleg V. Zhylin   ovz at yahoo.com


--- On Thu, 9/25/08, Adam Milazzo <adam at adammil.net> wrote:

> From: Adam Milazzo <adam at adammil.net>
> Subject: Re: Need to distinguish between g10_log_info and g10_log_error
> To: ovz at yahoo.com
> Cc: gnupg-devel at gnupg.org
> Date: Thursday, September 25, 2008, 8:06 PM
> Oleg V. Zhylin wrote:
> > I'm using gpg from Powershell and it detects error
> condition not by return value, but by presence of data on
> standard error.
> Is that really true? I thought the $? variable is set based
> on return value.


      



More information about the Gnupg-devel mailing list