Mailinglist Archive: opensuse-packaging (118 mails)

< Previous Next >
Re: [opensuse-packaging] suse_version handling troubles/solutions

Hello,

On Jun 11 14:50 Thorsten Kukuk wrote (excerpt):
The problem is that most of this changes are coming between
Service-Packs, so that you would need to distinguish between
if this change is already installed on the system or not.
Besides some other good reasons.

Are those good reasons confidential?

If not, could you provide that good reasons because
at least for me it feels better when I know why I do something
in contrast to blind obedience.


In particluar because what Tomáš Chvátal wrote
seems to be a contradicting idea:

Introduce extra macro, ie %opensuse_version YYYYMMDD
which would be based on the snapshots and always bumped,
so we can seriously finegrain what to

Only a gut feeling: I think such finegrained dependencies
lead to spec files where after some time nobody understands
what such dependencies actually mean.

I even think using product version tests in spec files
is fundamentally inappropriate because such tests do not
test for the actual requirement.

Therefore the plain test is meaningless so that additional
comments are required that tell what is going on, e.g.:
------------------------------------------------------------------
# Since openSUSE 13.2 the package foo provides something:
%if 0%{?suse_version} >= 1320
BuildRequires: foo
%endif
.
.
.
# Up to openSUSE 13.1 the package foo does not provide something:
%configure \
%if 0%{?suse_version} <= 1310
--without-something \
%endif
------------------------------------------------------------------
Intentionally I made here the mistake to leave out 1315.

I would prefer if I could test for the actual requirement like
------------------------------------------------------------------
%if %build_system_package_version foo >= 1.2.3
BuildRequires: foo
%endif
.
.
.
%configure \
%if %build_system_package_version foo >= 1.2.3
--with-something \
%else
--without-something \
%endif
------------------------------------------------------------------
or even better like
------------------------------------------------------------------
%if %build_system_package_provides foo something
BuildRequires: foo
%endif
.
.
.
%configure \
%if %build_system_package_provides foo something
--with-something \
%else
--without-something \
%endif
------------------------------------------------------------------


Kind Regards
Johannes Meixner
--
SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard,
Dilip Upmanyu, Graham Norton - HRB 21284 (AG Nuernberg)
< Previous Next >
Follow Ups