[opensuse-buildservice] modification of the release tag

Hello, Where can i find the piece of code which alters the release tag of the spec file? Is there maybe a way to avoid or influence this behaviour? For example the following is logged in the build log: I have the following modifications for aget-openSUSE_10.2.spec: 10c10 < Release: 5.2.opensuse10.2.rf ---
Release: 17.1
How is the '17' and the '1' calculated? Is it possible to append or prepend something? kind regards, Dries --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org

On 2007-05-22 14:30:42 +0200, Dries Verachtert wrote:
Where can i find the piece of code which alters the release tag of the spec file? Is there maybe a way to avoid or influence this behaviour?
For example the following is logged in the build log:
I have the following modifications for aget-openSUSE_10.2.spec: 10c10 < Release: 5.2.opensuse10.2.rf ---
Release: 17.1
i am not sure if it would be easy to get that string. i dont think we set something like %dist by default. and the distribution tag itself is way too long and contains whitespaces and other ugly chars. just as an example: $ rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}_%{DISTRIBUTION}\n' vim-base vim-base-7.0-99.1_home:darix / SUSE_Factory as you see the %DISTRIBUTION tag contains the local project name and the target repository. and i am not sure it would be enough to set %dist to the base distro.
How is the '17' and the '1' calculated? Is it possible to append or prepend something?
x.y: x == number of changes to the package (aka uploaded files) y == number of rebuilds. if b depends on a and a is rebuild, it will trigger a rebuild of b and you will will end with 17.2 (in your example) hope this helps darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org

On Tuesday May 22 2007, Marcus Rueckert wrote:
On 2007-05-22 14:30:42 +0200, Dries Verachtert wrote:
Where can i find the piece of code which alters the release tag of the spec file? Is there maybe a way to avoid or influence this behaviour?
For example the following is logged in the build log:
I have the following modifications for aget-openSUSE_10.2.spec: 10c10 < Release: 5.2.opensuse10.2.rf ---
Release: 17.1
i am not sure if it would be easy to get that string. i dont think we set something like %dist by default. and the distribution tag itself is way too long and contains whitespaces and other ugly chars.
I already added that string in the release tag of the spec file aget-openSUSE_10.2.spec.. It's just that the opensuse buildsystem doesn't use this release tag.
How is the '17' and the '1' calculated? Is it possible to append or prepend something?
x.y: x == number of changes to the package (aka uploaded files) y == number of rebuilds. if b depends on a and a is rebuild, it will trigger a rebuild of b and you will will end with 17.2 (in your example)
So it's not possible to override the release tag at this moment? Maybe the buildsystem could replace the release tag with something like '17.2%{?releasepostfix}' instead of '17.2', so people who want to append something to the release tag simply have to add a '%define releasepostfix bla' somewhere in the spec file? The reason for me for adding a repotag: i make rpms for different versions of distributions and i often get bugreports like "i downloaded and installed something-vers-rel.arch.rpm on my somedistro and it doesn't work!". Often users take an rpm for another distribution and just expect it to work. It makes life a lot easier for me if the name-version-release combination already contains an indication of which rpm exactly they're using. kind regards, Dries --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org

On Tuesday May 22 2007, Dries Verachtert wrote:
On Tuesday May 22 2007, Marcus Rueckert wrote:
On 2007-05-22 14:30:42 +0200, Dries Verachtert wrote:
[ discussion about a way to add something to the release tag ]
Hello, If i understand the code correctly, then the release tag is changed by the perl script 'substitutedeps', called from the bash script 'build'. The following small patch would allow some very minimal support for a suffix for the release tag (patch made in the dir trunk/buildservice/src/build/: Index: substitutedeps =================================================================== --- substitutedeps (revision 1692) +++ substitutedeps (working copy) @@ -80,7 +80,8 @@ next; } - $l =~ s/^(Release:\s*).*/$1$release/i if $release; + my $releasesuffixtag = "%{?releasesuffix}"; + $l =~ s/^(Release:\s*).*/$1$release$releasesuffixtag/i if $release; if (!$used || ($l !~ /^BuildRequires:/i)) { print F "$l\n"; Attention: i could only test this on some dummy files in /tmp :-) The packager still needs to add something like '%define releasesuffix .bla' explicitly in his spec file, so the normal behaviour doesn't change. Maybe later some functionality could be added which allows the user to add defines (key,value pairs) to a spec file or a group of spec files... Would a patch like this get accepted? kind regards, Dries --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org

On Wed, May 30, 2007 at 12:02:48PM +0200, Dries Verachtert wrote:
On Tuesday May 22 2007, Dries Verachtert wrote:
On Tuesday May 22 2007, Marcus Rueckert wrote:
On 2007-05-22 14:30:42 +0200, Dries Verachtert wrote:
[ discussion about a way to add something to the release tag ] If i understand the code correctly, then the release tag is changed by the perl script 'substitutedeps', called from the bash script 'build'. The following small patch would allow some very minimal support for a suffix for the release tag (patch made in the dir trunk/buildservice/src/build/:
This shouldn't be done in substitutedeps, but in the bs_worker program. Basically substitutedeps just substitues what was passed to the build script via the "--release" argument. 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 Wednesday May 30 2007, Michael Schroeder wrote:
On Wed, May 30, 2007 at 12:02:48PM +0200, Dries Verachtert wrote:
On Tuesday May 22 2007, Dries Verachtert wrote:
On Tuesday May 22 2007, Marcus Rueckert wrote:
On 2007-05-22 14:30:42 +0200, Dries Verachtert wrote:
[ discussion about a way to add something to the release tag ]
If i understand the code correctly, then the release tag is changed by the perl script 'substitutedeps', called from the bash script 'build'. The following small patch would allow some very minimal support for a suffix for the release tag (patch made in the dir trunk/buildservice/src/build/:
This shouldn't be done in substitutedeps, but in the bs_worker program. Basically substitutedeps just substitues what was passed to the build script via the "--release" argument.
Ok thanks for the information! A small patch which adds '%{?releasesuffix}' in bs_worker: Index: bs_worker =================================================================== --- bs_worker (revision 1692) +++ bs_worker (working copy) @@ -450,11 +450,12 @@ my $release; if (defined($buildinfo->{'release'})) { - $release = $buildinfo->{'release'}; + $release = $buildinfo->{'release'} . "%{?releasesuffix}"; } elsif (defined($buildinfo->{'versrel'}) && defined($buildinfo->{'bcnt'})) { $release = $buildinfo->{'versrel'}; $release =~ s/.*-//; $release .= ".$buildinfo->{'bcnt'}"; + $release .= "%{?releasesuffix}"; } my @args; push @args, $helper if $helper; kind regards, Dries --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org

On Wednesday May 30 2007, Dries Verachtert wrote:
On Wednesday May 30 2007, Michael Schroeder wrote:
On Wed, May 30, 2007 at 12:02:48PM +0200, Dries Verachtert wrote:
On Tuesday May 22 2007, Dries Verachtert wrote:
On Tuesday May 22 2007, Marcus Rueckert wrote:
On 2007-05-22 14:30:42 +0200, Dries Verachtert wrote:
[ discussion about a way to add something to the release tag ]
If i understand the code correctly, then the release tag is changed by the perl script 'substitutedeps', called from the bash script 'build'. The following small patch would allow some very minimal support for a suffix for the release tag (patch made in the dir trunk/buildservice/src/build/:
This shouldn't be done in substitutedeps, but in the bs_worker program. Basically substitutedeps just substitues what was passed to the build script via the "--release" argument.
Ok thanks for the information! A small patch which adds '%{?releasesuffix}' in bs_worker:
Index: bs_worker =================================================================== --- bs_worker (revision 1692) +++ bs_worker (working copy) @@ -450,11 +450,12 @@
my $release; if (defined($buildinfo->{'release'})) { - $release = $buildinfo->{'release'}; + $release = $buildinfo->{'release'} . "%{?releasesuffix}"; } elsif (defined($buildinfo->{'versrel'}) && defined($buildinfo->{'bcnt'})) { $release = $buildinfo->{'versrel'}; $release =~ s/.*-//; $release .= ".$buildinfo->{'bcnt'}"; + $release .= "%{?releasesuffix}"; } my @args; push @args, $helper if $helper;
Hello Michael, Do you think a patch like this could get included or would you like to have it implemented in a different way? kind regards, Dries --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org

On Thu, Jun 07, 2007 at 07:51:46AM +0200, Dries Verachtert wrote:
Hello Michael, Do you think a patch like this could get included or would you like to have it implemented in a different way?
It's now implemented a bit different. The release scheme is now part of the project configuration, i.e. you can put a line Release: <CI_CNT>.<B_CNT>%%{?releasesuffix} in the project.conf file. The advantage is that projects based on your project automatically get your release scheme and you can leave out the <B_CNT> if you don't like it. Enjoy, 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

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Michael Schroeder wrote: [...]
Release: <CI_CNT>.<B_CNT>%%{?releasesuffix} in the project.conf file. The advantage is that projects based
Pardon my ignorance but where/how can one change that "project.conf" ? cheers - -- -o) Pascal Bleser http://linux01.gwdg.de/~pbleser/ /\\ <pascal.bleser@skynet.be> <guru@unixtech.be> _\_v The more things change, the more they stay insane. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFGeNdPr3NMWliFcXcRAn1pAJ49A2O3YD+r9CkwYomJ+Jpxd/OjHgCgjVQE bwJ1HgJ5kdbb89dM9Qgl6vU= =KdQU -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org

On Wednesday 20 June 2007 09:29:19 wrote Pascal Bleser:
Michael Schroeder wrote: [...]
Release: <CI_CNT>.<B_CNT>%%{?releasesuffix} in the project.conf file. The advantage is that projects based
Pardon my ignorance but where/how can one change that "project.conf" ?
You can access it via GET /source/<project>/_config or PUT /source/<project>/_config via the api. Peter, do we have support for editing it in osc meanwhile ? bye adrian -- Adrian Schroeter SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG N�rnberg) email: adrian@suse.de --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org

On Wed, Jun 20, 2007 at 10:42:30AM +0200, Adrian Schröter wrote:
Pardon my ignorance but where/how can one change that "project.conf" ?
You can access it via
GET /source/<project>/_config
or
PUT /source/<project>/_config
via the api.
Peter, do we have support for editing it in osc meanwhile ?
No. I don't intend to add it without some other changes, see http://lists.opensuse.org/opensuse-buildservice/2007-05/msg00202.html and the two followups. Peter -- Allen Gewalten zum Trutz sich erhalten. SUSE LINUX Products GmbH Research & Development

On Wed, 30 May 2007, Dries Verachtert wrote:
Hello, If i understand the code correctly, then the release tag is changed by the perl script 'substitutedeps', called from the bash script 'build'. The following small patch would allow some very minimal support for a suffix for the release tag (patch made in the dir trunk/buildservice/src/build/:
Index: substitutedeps =================================================================== --- substitutedeps (revision 1692) +++ substitutedeps (working copy) @@ -80,7 +80,8 @@ next; }
- $l =~ s/^(Release:\s*).*/$1$release/i if $release; + my $releasesuffixtag = "%{?releasesuffix}"; + $l =~ s/^(Release:\s*).*/$1$release$releasesuffixtag/i if $release;
if (!$used || ($l !~ /^BuildRequires:/i)) { print F "$l\n";
Sorry, but I don't want to find out, how to press this into one regular expression, so I do it as follows: if($release) { my $obsrelease = "%{?obsrelease}"; if(!($l =~ s/^(Release:\s*.*)$obsrelease/$1$release/i)) { $l =~ s/^(Release:\s*).*/$1$release/i; } } NOTE: Untested code :-) Generally this should do: - When %{?obsrelease} is contained in the Release line replace it by the release version and leave everything intact. - When not, replace the whole release text. Result: - Allows suffixes, prefixes, and everything else one may think of - You need not defined any additional variable in spec-file - Also works without buildservice, as %{?obsrelease} is expanded to nothing then. Ciao -- http://www.dstoecker.eu/ (PGP key available) --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (7)
-
Adrian Schröter
-
Dirk Stoecker
-
Dr. Peter Poeml
-
Dries Verachtert
-
Marcus Rueckert
-
Michael Schroeder
-
Pascal Bleser