[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@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
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@gmail.com] Sent: Tuesday, January 26, 2010 5:58 AM To: opensuse-buildservice@opensuse.org 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@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
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@Dell.com 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@gmail.com] Sent: Tuesday, January 26, 2010 5:58 AM To: opensuse-buildservice@opensuse.org 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@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
-- Robert Xu Ever tried Linux? :) -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
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@gmail.com] Sent: Tuesday, January 26, 2010 2:42 PM To: Brown, Michael E; opensuse-buildservice@opensuse.org 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@Dell.com 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@gmail.com] Sent: Tuesday, January 26, 2010 5:58 AM To: opensuse-buildservice@opensuse.org 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@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
-- Robert Xu Ever tried Linux? :) -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
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@dell.com 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@gmail.com] Sent: Tuesday, January 26, 2010 2:42 PM To: Brown, Michael E; opensuse-buildservice@opensuse.org 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@Dell.com 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@gmail.com] Sent: Tuesday, January 26, 2010 5:58 AM To: opensuse-buildservice@opensuse.org 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@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
-- Robert Xu Ever tried Linux? :)
---- Jian Lee [ http://jianlee.ylinux.org ] -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
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@dell.com 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@gmail.com] Sent: Tuesday, January 26, 2010 2:42 PM To: Brown, Michael E; opensuse-buildservice@opensuse.org 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@Dell.com 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@gmail.com] Sent: Tuesday, January 26, 2010 5:58 AM To: opensuse-buildservice@opensuse.org 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@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
-- Robert Xu Ever tried Linux? :)
----
Jian Lee [ http://jianlee.ylinux.org ]
-- Robert Xu Ever tried Linux? :) -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Why would you ever change a code file like this when you can easily do this in the prjconf? That is just totally asking for trouble. http://en.opensuse.org/Build_Service/prjconf -- Michael ________________________________________ From: Robert Xu [robxu9@gmail.com] Sent: Tuesday, January 26, 2010 8:04 PM To: Jian Lee Cc: opensuse-buildservice@opensuse.org; Brown, Michael E Subject: Re: [opensuse-buildservice] %{?dist} in obs 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@dell.com 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@gmail.com] Sent: Tuesday, January 26, 2010 2:42 PM To: Brown, Michael E; opensuse-buildservice@opensuse.org 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@Dell.com 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@gmail.com] Sent: Tuesday, January 26, 2010 5:58 AM To: opensuse-buildservice@opensuse.org 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@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
-- Robert Xu Ever tried Linux? :)
----
Jian Lee [ http://jianlee.ylinux.org ]
-- Robert Xu Ever tried Linux? :) -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Maybe the doc at http://en.opensuse.org/Build_Service/prjconf is not more details. ;-) Michael_E_Brown@dell.com write:
Why would you ever change a code file like this when you can easily do this in the prjconf? That is just totally asking for trouble.
http://en.opensuse.org/Build_Service/prjconf -- Michael ________________________________________ From: Robert Xu [robxu9@gmail.com] Sent: Tuesday, January 26, 2010 8:04 PM To: Jian Lee Cc: opensuse-buildservice@opensuse.org; Brown, Michael E Subject: Re: [opensuse-buildservice] %{?dist} in obs
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@dell.com 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@gmail.com] Sent: Tuesday, January 26, 2010 2:42 PM To: Brown, Michael E; opensuse-buildservice@opensuse.org 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@Dell.com 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@gmail.com] Sent: Tuesday, January 26, 2010 5:58 AM To: opensuse-buildservice@opensuse.org 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@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
-- Robert Xu Ever tried Linux? :)
----
Jian Lee [ http://jianlee.ylinux.org ]
-- Robert Xu Ever tried Linux? :)
---- Jian Lee [ http://jianlee.ylinux.org ] -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (3)
-
Jian Lee
-
Michael_E_Brown@Dell.com
-
Robert Xu