On January 31, 2015 5:54:36 AM "Lubomir I. Ivanov" <[email protected]> wrote:
On 31 January 2015 at 15:29, Lubomir I. Ivanov <[email protected]> wrote:
> On 31 January 2015 at 00:45, Cristian Ionescu-Idbohrn
> <[email protected]> wrote:
>> Try this same thing with adding:
>>
>> set -eu
>> #set -x #xtrace
>>
>> Any of these may fail in absence of
>>
>> [ $# -eq 3 ] || {
>> echo "ERROR: missing argument(s)" # alternative, usage message
>> exit 1
>> }
>>
>
> i know of this, but it was problematic because $# seems buggy under
> MSYS, invoking from GNU-Make $# == 2, invoking from the cmd-line $# ==
> 3.
> thus, the above error checking is non-portable and it simply fails.
>
ok, i was able to get this to work, because it was too weird and the
number of argument is important.
CMD is the reason for the bad argument count, it passes an extra
argument for some reason and the equality check fails, but given users
will call the script from the MSYS shell or from a Makefile and not
from CMD directly this works:
(also -lt can be used as we ignore the rest of the arguments)
set -eu
#set -x
if [ "$#" -lt 3 ]; then
echo "ERROR: missing arguments";
exit 1;
fi
not setting #xtrace as the other scripts don't do that.
new patch attached.
Thanks for working on this.
All of my build scripts plus the way I package things for the various Linux
flavors depend heavily on the current way qmake works.
So I'm not going to take this patch before 4.4 and risk having to redo and
retest all of that.
I'll take it after 4.4
/D
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface