[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Forcing a script to bomb, etc.

Michael Jennings wrote:
On Friday, 12 October 2007, at 10:10:13 (-0700),
Philip Prindeville wrote:

 So... a few miscellaneous questions.

First, where is the current authoritative documentation? I've not found %{!? documented anywhere.


Ok, thanks.  Looking at the example:

%if %{?_with_ssl:1}%{!?_with_ssl:0}

that's a little more complicated than it needs to be, isn't it?

I've seen:

%if 0%{?_with_ssl:1}

And that seems to work equally well...

Second, is there a guide to what macros are common on all platforms, like %{with and %{without?

Not really, but the stuff in /usr/share/doc is a good start.


 Third, can I force an RPM to error with a message is a standard
 fashion, if it finds (for instance) that it's being built with a
 combination of incompatible --with options?

It's a shell script.  Do whatever you like.

Right, but I don't want to capture the shell exit value of %(...) as an expression.... I want to bomb out.

I suppose I could have:

%if !<some sanity tests here>
   echo "This can't possibly be correct." 1>&2
   exit 1

 Fourth, is it philosophically preferable to have a package build by
 default with everything, but have the package turn stuff off with
 --without xxx, or build the smallest supportable package, but turn
 things on via rpmbuild --with arguments?

It's your package; do it however you want.  I prefer to default to
building everything and require manual intervention to turn things
off.  Makes things more autobuilder-friendly.

That's what I wanted to do, but it got slapped down.

We could add an AutobuilderHint: field to the header that wouldn't do anything, but that autobuilders could grovel out and use as the default set of arguments...

Lastly, where's the documentation on writing and using macros that take arguments?

See above.


doc/macros it looks like.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]