Mailinglist Archive: opensuse-buildservice (89 mails)

< Previous Next >
[opensuse-buildservice] Re: system-wide prjconf?
On 31.01.2018 11:32, Stefan Seyfried wrote:
Hi,

I trying to clearly mark my local builds, currently with

Release: <CI_CNT>.<B_CNT>.SEIFE

in select project configs.
Now I want to do this for all projects in my OBS instance.
Is there a global prjconf I could edit, or is it necessary to
hack the code (which would probably be Build.pm in the obs-build
package)?

I looked at the backend code, but how the prjconf stuff is constructed
and inherited is beyond my understanding ;-)

ok, it's not that bad after all.
src/backend/bs_srcserver, looks like the place to be.

2245 if ($BSConfig::extramacros) {
2246 for (sort keys %{$BSConfig::extramacros}) {
2247 $macros .= $BSConfig::extramacros->{$_} if $projid =~ /$_/;
2248 }
2249 }
2250 if ($BSConfig::extraconfig) {
2251 my $extraconfig = '';
2252 for (sort keys %{$BSConfig::extraconfig}) {
2253 $extraconfig .= $BSConfig::extraconfig->{$_} if $projid =~ /$_/;
2254 }
2255 $config .= "\n$extraconfig" if $extraconfig;
2256 }
2257 $config .= "\nMacros:\n$macros" if $macros ne '';
2258 return $config;

so $BSConfig::extraconfig might work.
But it gets appended at the end and so individual projects can no longer
override it on their own...

Is there any chance to get something like this for adding "default" stuff at
the top of the config?
$BSConfig::extradefaults maybe? Should I create a patch?

ok. Another stupid question:
Why do we have this code copy-pasted 2 times?

# git grep extraconfig|cat
src/backend/BSRepServer/ProjPacks.pm: my $extraconfig = '';
src/backend/BSRepServer/ProjPacks.pm: if ($BSConfig::extraconfig) {
src/backend/BSRepServer/ProjPacks.pm: for (sort keys
%{$BSConfig::extraconfig}) {
src/backend/BSRepServer/ProjPacks.pm: $extraconfig .=
$BSConfig::extraconfig->{$_} if $projid =~ /$_/;
src/backend/BSRepServer/ProjPacks.pm: $config .= "\n$extraconfig" if
$extraconfig;
src/backend/BSSched/ProjPacks.pm: my $extraconfig = '';
src/backend/BSSched/ProjPacks.pm: if ($BSConfig::extraconfig) {
src/backend/BSSched/ProjPacks.pm: for (sort keys %{$BSConfig::extraconfig}) {
src/backend/BSSched/ProjPacks.pm: $extraconfig .=
$BSConfig::extraconfig->{$_} if $projid =~ /$_/;
src/backend/BSSched/ProjPacks.pm: $config .= "\n$extraconfig" if $extraconfig;
src/backend/bs_srcserver: if ($BSConfig::extraconfig) {
src/backend/bs_srcserver: my $extraconfig = '';
src/backend/bs_srcserver: for (sort keys %{$BSConfig::extraconfig}) {
src/backend/bs_srcserver: $extraconfig .= $BSConfig::extraconfig->{$_} if
$projid =~ /$_/;
src/backend/bs_srcserver: $config .= "\n$extraconfig" if $extraconfig;
--
Stefan Seyfried

"For a successful technology, reality must take precedence over
public relations, for nature cannot be fooled." -- Richard Feynman
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >
References