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

RH9/rpm-4.2.0-69: %expand:%() misbehaves on %if statements


I swear I searched for this one, but I didn't find it. Then again, I think this one's so far out in left field that maybe not so many people see it.

I've got a spec file, and part of it looks like this:
%{expand:%(tar xzfO %{S:0} <filename>}

In that file, I have a common construct:
%if "%(rpm -qf /etc/issue --qf %%{name})" == "redhat-release"
%define apacheName              %(rpm -q --qf "%%{name}" --whatprovides webserver)
%define apacheName              apache
> %define apacheDevelName %{apacheName}-devel

This is probably something EVERYONE's seen, unfortunately, or at least anyone who builds package for RH7 and RH9 and which depends on the web server being present (Joe, can ya toss a provides:webserver-devel in there?).

The problem is, when %expand picks up the output of the %(), it runs BOTH parts of the %if. It leads me to believe that %expand only deals with things line-by-line. True? If so, how does one do an %if/else like the above on a single line?

I fear much bashing.

Thanks for your time, folks. Happy Saturnalia.

- bish

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