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

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

 



On Thu, 2003-12-11 at 23:27, bishop wrote:
> 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)
> > %else
> > %define apacheName              apache
> > %endif
>  > %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?

Have you tried:

%{expand: %%define apacheName %%(rpm -q --qf "%%{name}" --whatprovides
webserver)}

(I'm not sure whether "%%{name}" will expand correctly, though ...)

and:

%{expand: %%define apacheName apache}

?


_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux