gnutls-devel
[Top][All Lists]
Advanced

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

[sr #107449] selftest sh-script fails on non-bash


From: anonymous
Subject: [sr #107449] selftest sh-script fails on non-bash
Date: Fri, 06 Aug 2010 20:49:33 +0000
User-agent: Mozilla/4.76 [en] (X11; U; OSF1 V5.1 alpha)

URL:
  <http://savannah.gnu.org/support/?107449>

                 Summary: selftest sh-script fails on non-bash
                 Project: GnuTLS
            Submitted by: None
            Submitted on: Fri 06 Aug 2010 08:49:33 PM UTC
                Category: None
                Priority: 5 - Normal
                Severity: 2 - Minor
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: *BSD

    _______________________________________________________

Details:

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.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/support/?107449>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]