Re: patch only if dependent version < x? (rpm spec)

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

 



On 06/02/2011 12:06 PM, Richard W.M. Jones wrote:
> How about this evil untested recursive invocation of rpm?
> 
> %prep
> %configure
> 
> package=glibc
> minversion=2.13.89
> 
> if [ $(
>   rpm -q --queryformat '%{version}\n' $package |
>     cat - <(echo $minversion) |
>     sort -V |
>     head -1
>   ) = "$minversion" ]; then
> %patch0 -p1
> fi

Please don't do that. Ever. Even if in this very specific case, it is
probably safe, invoking rpm within the spec file sets a very poor
example for the thousands of other cases where it is very unsafe/unreliable.

A better way would be to leverage the .pc file for the component being
BuildRequired, although, the .pc files sometimes have the API version as
opposed to the actual version (GNOME, I'm looking at you).

Alternate ideas include:

* Checking for a versioned directory
* Looking for a version definition in a header file
* Invoking a binary from the BR that spits out version

~tom

==
Fedora Project
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux