[build2] Optional parameter for build scripts
Moldmann Max (DC-MH/ENG52-NA)
Max.Moldmann at boschrexroth-us.com
Tue Dec 12 13:57:40 UTC 2017
Thanks Boris,
I think that would work.
Max
-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com]
Sent: Tuesday, December 12, 2017 1:12 AM
To: Moldmann Max (DC-MH/ENG52-NA) <Max.Moldmann at boschrexroth-us.com>
Cc: users at build2.org
Subject: Re: [build2] Optional parameter for build scripts
Moldmann Max (DC-MH/ENG52-NA) <Max.Moldmann at boschrexroth-us.com> writes:
> What do you think about adding an optional parameter that modifies the
> Exit code behavior, so that in case of "dir is up to date" build2 ends
> with a special Exit code. This way scripts that call build2 could know
> whether post-build-processing is necessary or not.
I see the need but using exit status for this feels wrong: target up to date is a "success" result but we will be returning a status indicating failure.
How about we instead print the target state to STDOUT? More specifically, if you specify --print-target-state option then instead of printing to STDERR user-friendly messages like "dir{./} is already up to date",
build2 will print to STDOUT structured state in the form:
<state> <meta-operation> <operation> <target>
For example:
unchanged perform update dir{./}
Will this work for you?
More information about the users
mailing list