[opensuse-buildservice] project configs and macros
I am having a bear of a time with something. I've defined, in two different projects (let's call them foo version 25 and foo version 26), in the Macros: section, two items like this: Macros: %define fooversion 25 fooversion 25 (and 26 for version 26). Then, in *other* projects which have the foo projects as build repos, I wanted to do this: %if 0%{?fooversion} == 25 do stuff for version 25 here %endif %if 0%{?fooversion} == 26 do stuff for version 26 here %endif But that doesn't seem to work. What am I doing wrong? I thought project configs "stacked" somehow? Do they? -- Jon -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Sunday 2010-07-11 01:09, Jon Nelson wrote:
Macros:
%define fooversion 25 fooversion 25
Because it's supposed to be %fooversion 25 and that only. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Sun, Jul 11, 2010 at 3:10 AM, Jan Engelhardt
On Sunday 2010-07-11 01:09, Jon Nelson wrote:
Macros:
%define fooversion 25 fooversion 25
Because it's supposed to be
%fooversion 25
and that only.
OK, but what about my other questions. Are they stacked or appended somehow? Let's say I have FooDistro-1.0 and FooDistro-2.0 (these are for sources only, no packages get built). Let's say I have stuff:apple and stuff:banana. stuff:apple has build repos for both FooDistro versions. stuff:banana only makes use of stuff:apple. In both FooDistro project configs, following "Macros:", I have: %foodistro_version 10 %define foodistro_version 10 (or 20 for version 2.0). Then, in stuff:apple I want to make use of that: %if 0%{?foodistro_version} == 10 Substitute: packageA packageB %endif %if 0%{?foodistro_version} == 20 Substitute: packageB packageA %endif because in 2.0 I want to use packageA whenever it or packageB are specified, and vice versa in version 1.0. But that didn't seem to work. So, how exactly are project configs combined with build repository configs and so on? -- Jon -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Jul 11, 2010, at 11:10, Jon Nelson
On Sun, Jul 11, 2010 at 3:10 AM, Jan Engelhardt
wrote: On Sunday 2010-07-11 01:09, Jon Nelson wrote:
Macros:
%define fooversion 25 fooversion 25
Because it's supposed to be
%fooversion 25
and that only.
OK, but what about my other questions. Are they stacked or appended somehow?
Let's say I have FooDistro-1.0 and FooDistro-2.0 (these are for sources only, no packages get built). Let's say I have stuff:apple and stuff:banana. stuff:apple has build repos for both FooDistro versions. stuff:banana only makes use of stuff:apple.
In both FooDistro project configs, following "Macros:", I have:
%foodistro_version 10 %define foodistro_version 10
No no no. Take out the %define foodistro_version 10
(or 20 for version 2.0).
Then %foodistro_version 20? That overrides the foodistro_version 10.
Then, in stuff:apple I want to make use of that:
%if 0%{?foodistro_version} == 10 Substitute: packageA packageB %endif
%if 0%{?foodistro_version} == 20 Substitute: packageB packageA %endif
because in 2.0 I want to use packageA whenever it or packageB are specified, and vice versa in version 1.0.
But that didn't seem to work.
So, how exactly are project configs combined with build repository configs and so on?
See the opensuse wiki for more info. Should be in the Category:Build Service under prjconf.
-- Jon
-- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Sun, Jul 11, 2010 at 10:23 AM, Robert Xu
On Jul 11, 2010, at 11:10, Jon Nelson
wrote: On Sun, Jul 11, 2010 at 3:10 AM, Jan Engelhardt
wrote: On Sunday 2010-07-11 01:09, Jon Nelson wrote:
Macros:
%define fooversion 25 fooversion 25
Because it's supposed to be
%fooversion 25
and that only.
OK. I was patterning things after what I found here: osc meta prjconf CentOS:CentOS-5 although I got it partly wrong (I had the %define line after Macros:). The output from that command has the following (pasted exactly, minus the '=' lines): ====== Substitute: popt-devel popt %define centos_version 501 Macros: %opensuse_bs 1 %centos_version 501 %_vendor redhat ====== According to the docs, the "%define centos_version 501" line is usable *only* in the project config, and the macros defined after the "Macros:" line are usable in spec files as though they appeared in .rpmmacros. Is that correct?
OK, but what about my other questions. Are they stacked or appended somehow?
Let's say I have FooDistro-1.0 and FooDistro-2.0 (these are for sources only, no packages get built). Let's say I have stuff:apple and stuff:banana. stuff:apple has build repos for both FooDistro versions. stuff:banana only makes use of stuff:apple.
In both FooDistro project configs, following "Macros:", I have:
%foodistro_version 10 %define foodistro_version 10
No no no. Take out the %define foodistro_version 10
(or 20 for version 2.0).
Then %foodistro_version 20? That overrides the foodistro_version 10.
There are *two* projects, one that is version 1.0 and one that is version 2.0. Version 1.0 uses 10 and version 2.0 uses 20, patterned after what I've seen in the suse_version (and other) macros.
See the opensuse wiki for more info. Should be in the Category:Build Service under prjconf.
That's what I started with, but the docs were unclear to me, which is why I asked. -- Jon -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Sun, Jul 11, 2010 at 2:29 PM, Jon Nelson
On Sun, Jul 11, 2010 at 10:23 AM, Robert Xu
wrote: On Jul 11, 2010, at 11:10, Jon Nelson
wrote: On Sun, Jul 11, 2010 at 3:10 AM, Jan Engelhardt
wrote: On Sunday 2010-07-11 01:09, Jon Nelson wrote:
Macros:
%define fooversion 25 fooversion 25
Because it's supposed to be
%fooversion 25
and that only.
OK. I was patterning things after what I found here:
osc meta prjconf CentOS:CentOS-5
although I got it partly wrong (I had the %define line after Macros:).
The output from that command has the following (pasted exactly, minus the '=' lines):
======
Substitute: popt-devel popt
%define centos_version 501
Macros: %opensuse_bs 1 %centos_version 501 %_vendor redhat
======
According to the docs, the "%define centos_version 501" line is usable *only* in the project config, and the macros defined after the "Macros:" line are usable in spec files as though they appeared in .rpmmacros.
Is that correct?
OK, but what about my other questions. Are they stacked or appended somehow?
Let's say I have FooDistro-1.0 and FooDistro-2.0 (these are for sources only, no packages get built). Let's say I have stuff:apple and stuff:banana. stuff:apple has build repos for both FooDistro versions. stuff:banana only makes use of stuff:apple.
In both FooDistro project configs, following "Macros:", I have:
%foodistro_version 10 %define foodistro_version 10
I've given it a try and it does not appear to be stacking the way I expect, or I'm doing it wrong. I have the following projects: A B C and D. A and B are different versions of the same base distro. C has A and B as build repositories. D has C has a build repository. A and B have project configs that look like this: A has this: %define foo_version 10 and that line does not follow the Macros: line. B has this: %define foo_version 20 and that line does not follow the Macros: line. C has this as it's *only* project config: %if 0%{?foo_version} == 10 Substitute: packageA packageB %endif %if 0%{?foo_version} == 20 Substitute: packageB packageA %endif However, packages built in project C for repo A (which should have foo_version 10) are using packageB. If the Substitute directive was being followed, that should not be. How do I debug this? It feels like a black box and I've tried lots of permutations without luck. -- Jon -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Sun, Jul 11, 2010 at 15:42, Jon Nelson
On Sun, Jul 11, 2010 at 2:29 PM, Jon Nelson
wrote: On Sun, Jul 11, 2010 at 10:23 AM, Robert Xu
wrote: On Jul 11, 2010, at 11:10, Jon Nelson
wrote: On Sun, Jul 11, 2010 at 3:10 AM, Jan Engelhardt
wrote: On Sunday 2010-07-11 01:09, Jon Nelson wrote:
Macros:
%define fooversion 25 fooversion 25
Because it's supposed to be
%fooversion 25
and that only.
OK. I was patterning things after what I found here:
osc meta prjconf CentOS:CentOS-5
although I got it partly wrong (I had the %define line after Macros:).
The output from that command has the following (pasted exactly, minus the '=' lines):
======
Substitute: popt-devel popt
%define centos_version 501
Macros: %opensuse_bs 1 %centos_version 501 %_vendor redhat
======
According to the docs, the "%define centos_version 501" line is usable *only* in the project config, and the macros defined after the "Macros:" line are usable in spec files as though they appeared in .rpmmacros.
Is that correct?
OK, but what about my other questions. Are they stacked or appended somehow?
Let's say I have FooDistro-1.0 and FooDistro-2.0 (these are for sources only, no packages get built). Let's say I have stuff:apple and stuff:banana. stuff:apple has build repos for both FooDistro versions. stuff:banana only makes use of stuff:apple.
In both FooDistro project configs, following "Macros:", I have:
%foodistro_version 10 %define foodistro_version 10
I've given it a try and it does not appear to be stacking the way I expect, or I'm doing it wrong.
I have the following projects:
A B C and D.
A and B are different versions of the same base distro. C has A and B as build repositories. D has C has a build repository.
A and B have project configs that look like this:
A has this:
%define foo_version 10
and that line does not follow the Macros: line.
B has this:
%define foo_version 20
and that line does not follow the Macros: line.
C has this as it's *only* project config:
%if 0%{?foo_version} == 10 Substitute: packageA packageB %endif
%if 0%{?foo_version} == 20 Substitute: packageB packageA %endif
However, packages built in project C for repo A (which should have foo_version 10) are using packageB. If the Substitute directive was being followed, that should not be.
How do I debug this? It feels like a black box and I've tried lots of permutations without luck.
Try something like %if %{repository} == Fedora_13 or something like that. I know that when you add the kiwi image repo, it adds something like that to the repository. -- later, Robert Xu -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Try something like %if %{repository} == Fedora_13 or something like that. I know that when you add the kiwi image repo, it adds something like that to the repository.
Actually, using _repository: %if %{_repository} == Foo_1_0 (or whatever is appropriate) works fine. What I don't understand is why it's not working the way I expect with *other* macros. It appears as though the second Substitute line is *always* being applied. NOTE: since I wrote this, I've started over and have to wait until a bunch of packages build to see if I get what I want. -- Jon -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Sun, Jul 11, 2010 at 16:00, Jon Nelson
Try something like %if %{repository} == Fedora_13 or something like that. I know that when you add the kiwi image repo, it adds something like that to the repository.
Actually, using _repository:
%if %{_repository} == Foo_1_0
(or whatever is appropriate)
works fine.
What I don't understand is why it's not working the way I expect with *other* macros. It appears as though the second Substitute line is *always* being applied.
NOTE: since I wrote this, I've started over and have to wait until a bunch of packages build to see if I get what I want.
Your project config is pretty much an "overlay" over the repository config. Always treat it that way. -- later, Robert Xu -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Sun, Jul 11, 2010 at 02:42:44PM -0500, Jon Nelson wrote:
On Sun, Jul 11, 2010 at 2:29 PM, Jon Nelson
wrote: On Sun, Jul 11, 2010 at 10:23 AM, Robert Xu
wrote: On Jul 11, 2010, at 11:10, Jon Nelson
wrote: On Sun, Jul 11, 2010 at 3:10 AM, Jan Engelhardt
wrote: On Sunday 2010-07-11 01:09, Jon Nelson wrote:
Macros:
%define fooversion 25 fooversion 25
Because it's supposed to be
%fooversion 25
and that only.
OK. I was patterning things after what I found here:
osc meta prjconf CentOS:CentOS-5
although I got it partly wrong (I had the %define line after Macros:).
The output from that command has the following (pasted exactly, minus the '=' lines):
======
Substitute: popt-devel popt
%define centos_version 501
Macros: %opensuse_bs 1 %centos_version 501 %_vendor redhat
======
According to the docs, the "%define centos_version 501" line is usable *only* in the project config, and the macros defined after the "Macros:" line are usable in spec files as though they appeared in .rpmmacros.
Is that correct?
OK, but what about my other questions. Are they stacked or appended somehow?
Let's say I have FooDistro-1.0 and FooDistro-2.0 (these are for sources only, no packages get built). Let's say I have stuff:apple and stuff:banana. stuff:apple has build repos for both FooDistro versions. stuff:banana only makes use of stuff:apple.
In both FooDistro project configs, following "Macros:", I have:
%foodistro_version 10 %define foodistro_version 10
I've given it a try and it does not appear to be stacking the way I expect, or I'm doing it wrong.
I have the following projects:
A B C and D.
A and B are different versions of the same base distro. C has A and B as build repositories. D has C has a build repository.
A and B have project configs that look like this:
A has this:
%define foo_version 10
and that line does not follow the Macros: line.
B has this:
%define foo_version 20
and that line does not follow the Macros: line.
C has this as it's *only* project config:
%if 0%{?foo_version} == 10 Substitute: packageA packageB %endif
%if 0%{?foo_version} == 20 Substitute: packageB packageA %endif
However, packages built in project C for repo A (which should have foo_version 10) are using packageB. If the Substitute directive was being followed, that should not be.
How do I debug this? It feels like a black box and I've tried lots of permutations without luck.
Run osc api build/C/A/_buildconfig and check if the concatenated configs look like you want them to look. Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Sunday 2010-07-11 17:10, Jon Nelson wrote:
Macros:
%define fooversion 25 fooversion 25
Because it's supposed to be %fooversion 25 and that only.
OK, but what about my other questions. Are they stacked or appended somehow?
Stacked as expected.
Let's say I have FooDistro-1.0 and FooDistro-2.0 (these are for sources only, no packages get built). Let's say I have stuff:apple and stuff:banana. stuff:apple has build repos for both FooDistro versions. stuff:banana only makes use of stuff:apple. Then, in stuff:apple I want to make use of that:
%if 0%{?foodistro_version} == 10 Substitute: packageA packageB %endif
%if 0%{?foodistro_version} == 20 Substitute: packageB packageA %endif
because in 2.0 I want to use packageA whenever it or packageB are specified, and vice versa in version 1.0.
But that didn't seem to work.
So, how exactly are project configs combined with build repository configs and so on?
Should be linearly. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Sun, Jul 11, 2010 at 10:10:26AM +0200, Jan Engelhardt wrote:
On Sunday 2010-07-11 01:09, Jon Nelson wrote:
Macros:
%define fooversion 25 fooversion 25
Because it's supposed to be
%fooversion 25
and that only.
Yes, the Macros section is simply copied to ~/.rpmmacros when the build is done. Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (4)
-
Jan Engelhardt
-
Jon Nelson
-
Michael Schroeder
-
Robert Xu