Mailinglist Archive: opensuse-buildservice (91 mails)

< Previous Next >
Re: [opensuse-buildservice] Question about logic in an example spec file?
On Thu, Dec 31, 2015 at 2:37 PM, <jimssupp@xxxxxxxxxxxx> wrote:
I'm getting started writing a spec file for use on OBS.

I'm looking at some examples to help figure stuff out.

In one pkg's spec file there's this piece of code

%if 0%{?suse_version} >= 1210 || 0%{?fedora_version}
(1) BuildRequires: systemd
%{?systemd_requires}
%define have_systemd 1
%else
%if 0%{?suse_version} <= 1220
(2) PreReq: %fillup_prereq
PreReq: %insserv_prereq
%endif
%if 0%{?suse_version} > 1220
(3) PreReq: %fillup_prereq
Requires: /usr/sbin/service
%endif
%endif
------

The way I read that if the Suse version >= 1210, the (1) 'if' clause will
exec, and (2) & (3) will be skipped.

But (3) requires Suse version > 1220 to execute.

So there's NO WAY for the (3) clause to ever be reached, right?

Why's it in there?

Jim

As a guess:

A lot of spec files in OBS are updated via automated scripts. They
aren't always the smartest.

The code probably had:

%if 0%{?suse_version} >= 1210 || 0%{?fedora_version}
(1) BuildRequires: systemd
%{?systemd_requires}
%define have_systemd 1
%else
(2) PreReq: %fillup_prereq
PreReq: %insserv_prereq
%endif

Before an automated script came along and fixed the else clause.

One way to tell is to look back at the revision history of the spec
file. Hopefully the changes file will detail that an automated script
made the change.

Greg
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >
List Navigation
Follow Ups
References