[PATCH] qmake: use a dedicated build script to generate ssrf-version.h

Lubomir I. Ivanov neolit123 at gmail.com
Sat Jan 31 05:56:48 PST 2015


On 31 January 2015 at 15:29, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
> On 31 January 2015 at 00:45, Cristian Ionescu-Idbohrn
> <cristian.ionescu-idbohrn at axis.com> 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.

lubomir
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-qmake-use-a-dedicated-build-script-to-generate-ssrf-.patch
Type: application/octet-stream
Size: 6422 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150131/b41e5e6b/attachment.obj>


More information about the subsurface mailing list