Re: Detecting version of rpm in a spec file

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

 




On Jan 10, 2006, at 10:19 AM, Michael A. Peters wrote:

I want to take advantage of the new Suggests: tag, but I want to (if at
all possible) keep the spec files so they will build under older rpm.


If you can't upgrade rpm, then rpm can't help you.

Is Suggests: really any different than the confusion induced
by vendor macros?

Technically, Suggests: is a compiled in token that depends on the implementation,
while macros in principle can be changed without changing code.

Does it really matter? Is it that hard to add '#' in front of Suggests:? Are there any users
and developers left who know how to use a text editor?

And the real problem is not Suggests: syntax, but rather semantic interpretation, which will invariably lead to implementation peculier interpretations that *force* a much narrower
deployment context than what rpm or rpmbuild imposes.

Some places where might be useful are packages like pan - which requires
gedit because it needs a text editor (and uses gedit by default in the
rpm), but could be configured to be used with a different one.

This works -

%define my_rpm_v %(eval "echo `rpm -q rpm |cut -d '-' -f2 |sed
s?'\.'?''?g`")
%define use_suggest %(eval "if [ %{my_rpm_v} -ge 443 ]; then echo 1;
else echo 0
; fi")

then later

%if %{use_suggest}
Suggests: foobar
%else
Requires: foobar
%endif

but I know it is wrong -

1) It assumes that rpm version will always be numbers, with only 3
fields
2) It assumes first rpm in path is what is building the spec file
3) Probably other stuff wrong with it.


If all you want is the rpm version predefined as a macro, I can do that with 5-10 lines of
code. Less work than writing this e-mail message.

IMHO, that solves no problem whatsoever, as you *still* will have versions of rpm around
that support Suggests: and won't have the blessed rpm macro.

Can you spell U-P-G-R-A-D-E?

What would be the best way to create a use_suggest macro so that the
spec file will build on rpm < 4.4.3 ?


Don't use what you cannot write and maintain reliably.

73 de Jeff

_______________________________________________
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