ntpsec | Add dextral mode and srchost variable use options and better column autowidth. (!1033)

Richard Laager rlaager at wiktel.com
Sun Feb 23 05:01:32 UTC 2020


On 2/22/20 8:57 PM, James Browning via devel wrote:
>> Looks like the second test is backwards.  It's printing the message on a
>> system where pipefail works.
>>
>> if (set -o pipefail) 2>/dev/null
>> then
>>   echo "### Old sh - no pipefail"
>>   echo "### We can't test for errors during build"
>>   echo "### You will have to scan the log files."
>>   PURGE="${PURGE} pipefail"
>> fi
> I am reasonably sure that is happening because I rewrote that test. It
> should probably replace the first line with.
> 
> (set -o pipefail) 2>/dev/null
> if [[ $? -ne 0 ]]
> 
> or something roughly equivalent to test the exit code not the contents
> from stdout.

It is checking the exit status. () is a subshell. $() captures stdout.

It just needs this, which I just did:
-if (set -o pipefail) 2>/dev/null
+if ! (set -o pipefail) 2>/dev/null

Sorry I missed this in the review.

-- 
Richard

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20200222/30242a6c/attachment.bin>


More information about the devel mailing list