Ralf Angeli <[EMAIL PROTECTED]> writes:
>> + test -r info/auctex.info
>> + echo info/auctex.info
>> + for i in auctex preview-latex
>> + test -r info/preview-latex.info
>> ghanima:/usr/local/lib/xemacs/xemacs-packages# echo $?
>> + echo 1
>> 1
>> ghanima:/usr/local/lib/xemacs/xemacs-packages#
>>
>> This is because the return code of "test" becomes the return code of
>> "for". My patch was of course to hackish. Better do:
>>
>> if test -r ...; then
>> echo ... > pkginfo;
>> fi
>>
>> "if" does not propagate the value of its conditional, in contrast to the
>> "conditional && then" construction.
A myth, unfortunately.
(info "(autoconf) Limitations of Builtins")
`if'
[...]
There are shells that do not reset the exit status from an `if':
$ if (exit 42); then true; fi; echo $?
42
whereas a proper shell should have printed `0'. This is especially
bad in Makefiles since it produces false failures. This is why
properly written Makefiles, such as Automake's, have such hairy
constructs:
if test -f "$file"; then
install "$file" "$dest"
else
:
fi
I don't remember off-bat what the test is supposed to do. Maybe the
right operation would be
test ! -r whatever || do something with whatever
> David can probably say more about why && is used instead of if..then
> in the case at hand.
if..then without else is not always good with regard to exit status.
It may be that the wrong replacement was used here.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
_______________________________________________
bug-auctex mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-auctex