mainGnuTLS - Support: sr #107449, selftest sh-script fails on...

 
 

sr #107449: selftest sh-script fails on non-bash

Submitter:  None
Submitted:  Fri 06 Aug 2010 08:49:33 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  2 - Minor Status:  Done
Privacy:  Public Assigned to:  jas
Originator Email:  -email is unavailable- Open/Closed:  Closed
Operating System:  *BSD
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 30 Sep 2010 08:41:24 PM UTC, comment #1: 

Thanks, applied and pushed.

Simon Josefsson <jas>
Group administrator
Fri 06 Aug 2010 08:49:33 PM UTC, original submission:  

tests/openpgp-certs/testselfsigs sets "set -e" but later does:
unset RETCODE

This happens to work with bash because "unset" doesn't give an error
there if the variable wasn't defined before.
A regular/Posix sh gives a non-zero return code here, stopping the
script in its tracks due to the "-e".
See http://www.opengroup.org/onlinepubs/000095399/utilities/unset.html
for reference. The wording is somewhat poor because it says
"Unsetting a variable or function that was not previously set shall
not be considered an error and does not cause the shell to abort".
It is not about aborting in the common case but about the exit code;
the aborting would only due to the "-e".
Anyway, the sh and ksh implementations I found give a non-zero
return code in this situation.

Replacing the offending line with
unset RETCODE || true
fixes the issue.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jas (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-09-30 jas StatusNone Done
        Assigned toNone jas
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code