Re: Forcing a script to bomb, etc.

Michael Jennings <[email protected]>
Newsgroups gmane.linux.redhat.rpm.general
Message-ID <[email protected]>
On Friday, 12 October 2007, at 15:57:01 (-0700),
Philip Prindeville wrote:

>  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...

Either will work.  "More clear" vs. "more complicated" is often in the
eye of the beholder.

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

I never said anything about %(...)

>  I suppose I could have:
> 
>  %prep
>  ...
>  %if !<some sanity tests here>
>     echo "This can't possibly be correct." 1>&2
>     exit 1
>  %endif

If you think that's necessary.

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

You'll learn over time whose advice to listen to and whose to ignore.
You may have chosen poorly.  :-)

>  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...

Such a tag would be completely non-portable and entirely outside the
scope of anything RPM should be managing.

Michael

-- 
Michael Jennings (a.k.a. KainX)  http://www.kainx.org/  <[email protected]>
Linux Server/Cluster Admin, LBL.gov       Author, Eterm (www.eterm.org)
-----------------------------------------------------------------------
 "My program's in an infinite loop.  Should I wait for it to
  finish?"   -- some lame luser in a Tarleton State Univ. computer lab
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.