Mailinglist Archive: opensuse-buildservice (306 mails)

< Previous Next >
Re: [opensuse-buildservice] %{?dist} in obs
  • From: Robert Xu <robxu9@xxxxxxxxx>
  • Date: Tue, 26 Jan 2010 21:04:15 -0500
  • Message-id: <4B5F9F1F.2070703@xxxxxxxxx>
ok, thanks! i'll modify my spec files, and i'll try the change on the Build.pm. :)
thanks all again :)

On 1/26/2010 9:02 PM, Jian Lee wrote:
Hi, robxu

if you did not like the CI_CNT and B_CNT, and you have setup your local
obs server, disable the change of "release" macro by obs is a good idea.

I disable it at /usr/lib/obs/server/build/Build.pm :

149 #$config->{'release'} = '<CI_CNT>.<B_CNT>';


If you use the obs service of other server, you just only can modified
the Project Config. ;-)


Michael_E_Brown@xxxxxxxx write:

That works just fine. As long as you have it in the prjconf with the
doubled-up '%', it will do whatever you want:

Given example rpm:
name: foo
version: 1.0

checkin count = 42
build count = 3

with Prjconf:

Release: 1%%{?dist}
== foo-1.0-1.dist

Release: 123.<CI_CNT>%%dist
== foo-1.0-123.42.dist

Release: 42
== foo-1.0-42

etc. You should see the pattern. The key is that you have to %% or
else %{?dist} gets evaluated *before* it is substituted into the SPEC
file, which ends up being a nil string. --
Michael

________________________________________
From: Robert Xu [robxu9@xxxxxxxxx]
Sent: Tuesday, January 26, 2010 2:42 PM
To: Brown, Michael E; opensuse-buildservice@xxxxxxxxxxxx
Subject: Re: [opensuse-buildservice] %{?dist} in obs

well, does that expand right?
because i would like to do something like this:

Release:<release#>%{dist}

and when %{dist} expands, i want the result:

packagename-3.6-1.dist.rpm

where ".dist" is %{dist}

On 1/26/2010 10:07 AM, Michael_E_Brown@xxxxxxxx wrote:
I assume you want to do something like this:

Release:<CI_CNT>.<B_CNT>%%{?dist}

Note the double %%, or else %{?dist} is expanded too early,
resulting in a nil string. This is how I have my projects
configured. --
Michael

________________________________________
From: Robert Xu [robxu9@xxxxxxxxx]
Sent: Tuesday, January 26, 2010 5:58 AM
To: opensuse-buildservice@xxxxxxxxxxxx
Subject: [opensuse-buildservice] %{?dist} in obs

Hello all,

As you know, the Fedora macros have a dist macro in the release of
their packages. So I set my own dist macro in the Project Config and
everytime it builds, it changes dist to a random number. Help?

Robert Xu
Ever tried Linux? :)
--
To unsubscribe, e-mail:
opensuse-buildservice+unsubscribe@xxxxxxxxxxxx For additional
commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx
--
Robert Xu
Ever tried Linux? :)




----

Jian Lee [ http://jianlee.ylinux.org ]

--
Robert Xu
Ever tried Linux? :)

--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups