[opensuse-buildservice] Moving a package to another project maintaining history (and Release.Build)
Hi, Is there an easy way to move packages while maintaining the source change history and the release.build numbers? Anas-- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 12/22/2010 04:41 PM, Anas Nashif wrote:
Hi, Is there an easy way to move packages while maintaining the source change history and the release.build numbers?
Anas-- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Hi, I have done such manipulations already for restoring complete OBS systems. It is possible with some handy work. With that method, I have restored complete OBS systems incl. the SQL DB from the meta data in XML format. Martin -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2010-12-22, at 9:22 PM, Martin Mohring wrote:
On 12/22/2010 04:41 PM, Anas Nashif wrote:
Hi, Is there an easy way to move packages while maintaining the source change history and the release.build numbers?
Anas-- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Hi,
I have done such manipulations already for restoring complete OBS systems. It is possible with some handy work.
Yes, I know about the "hand" work, I just want to be able to do that using the API :)
With that method, I have restored complete OBS systems incl. the SQL DB from the meta data in XML format.
Been there, done that. It is not pleasant and works well when moving complete projects, but is tedious when doing that a package per package basis!. Anas
Martin
-- 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
Hi, so I gave it a try, spent 15 minutes and came up with this patch, which works for me (against 2.1 branch) :-) It is too easy to be true. (of course this patch is missing the API changes which add keephist, but that is even more easier). Any feedback? Anas +++ /usr/lib/obs/server/bs_srcserver 2010-12-22 17:24:38.339160313 -0800 @@ -3657,7 +3657,14 @@ copyfiles($projid, $packid, $oprojid, $opackid, $files); $files = keeplink($cgi, $projid, $packid, $files) if $cgi->{'keeplink'}; - my $rev = addrev($projid, $packid, $files, $cgi->{'user'}, $cgi->{'comment'}, $cgi->{'rev'}, $cgi->{'requestid'}); + my $rev; + if ( $cgi->{'keephist'} && !getrev($projid, $packid, 'latest')->{'rev'}) { + my @res = BSFileDB::fdb_getall("$projectsdir/$oprojid.pkg/$opackid.rev", $srcrevlay ); + BSFileDB::fdb_add_multiple("$projectsdir/$projid.pkg/$packid.rev", $srcrevlay, @res); + $rev = $orev; + } else { + $rev = addrev($projid, $packid, $files, $cgi->{'user'}, $cgi->{'comment'}, $cgi->{'rev'}, $cgi->{'requestid'}); + } if ($autosimplifylink && !$autosimplifylink->{'rev'}) { my $isbranch = grep {(keys %$_)[0] eq 'branch'} @{$autosimplifylink->{'patches'}->{''} || []}; @@ -5331,7 +5338,7 @@ 'POST:/source/$project/$package cmd=linkdiff rev? linkrev? unified:bool?' => \&linkdiff, 'POST:/source/$project/$package cmd=commit rev? user:? comment:? keeplink:bool? repairlink:bool? linkrev? noservice:bool?' => \&sourcecommit, 'POST:/source/$project/$package cmd=commitfilelist rev? user:? comment:? keeplink:bool? repairlink:bool? linkrev? noservice:bool? requestid:num?' => \&sourcecommitfilelist, - 'POST:/source/$project/$package cmd=copy rev? user:? comment:? orev:rev? oproject:project? opackage:package? expand:bool? keeplink:bool? repairlink:bool? linkrev? olinkrev:linkrev? requestid:num? dontupdatesource:bool?' => \&sourcecopy, + 'POST:/source/$project/$package cmd=copy rev? user:? comment:? orev:rev? oproject:project? opackage:package? expand:bool? keeplink:bool? repairlink:bool? linkrev? olinkrev:linkrev? requestid:num? dontupdatesource:bool? keephist:bool?' => \&sourcecopy, 'POST:/source/$project/$package cmd=branch rev? user:? comment:? orev:rev? oproject:project? opackage:package? olinkrev:linkrev? force:bool?' => \&sourcebranch, 'POST:/source/$project/$package cmd=linktobranch rev? user:? comment:? linkrev?' => \&linktobranch, 'POST:/source/$project/$package cmd=deleteuploadrev' => \&deleteuploadrev, On 2010-12-22, at 3:41 PM, Anas Nashif wrote:
Hi, Is there an easy way to move packages while maintaining the source change history and the release.build numbers?
Anas-- 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
any comments on this? Or is it so bad and not work commenting on? :) Anas On 2010-12-23, at 1:39 AM, Anas Nashif wrote:
Hi,
so I gave it a try, spent 15 minutes and came up with this patch, which works for me (against 2.1 branch) :-) It is too easy to be true.
(of course this patch is missing the API changes which add keephist, but that is even more easier).
Any feedback? Anas
+++ /usr/lib/obs/server/bs_srcserver 2010-12-22 17:24:38.339160313 -0800 @@ -3657,7 +3657,14 @@ copyfiles($projid, $packid, $oprojid, $opackid, $files);
$files = keeplink($cgi, $projid, $packid, $files) if $cgi->{'keeplink'}; - my $rev = addrev($projid, $packid, $files, $cgi->{'user'}, $cgi->{'comment'}, $cgi->{'rev'}, $cgi->{'requestid'}); + my $rev; + if ( $cgi->{'keephist'} && !getrev($projid, $packid, 'latest')->{'rev'}) { + my @res = BSFileDB::fdb_getall("$projectsdir/$oprojid.pkg/$opackid.rev", $srcrevlay ); + BSFileDB::fdb_add_multiple("$projectsdir/$projid.pkg/$packid.rev", $srcrevlay, @res); + $rev = $orev; + } else { + $rev = addrev($projid, $packid, $files, $cgi->{'user'}, $cgi->{'comment'}, $cgi->{'rev'}, $cgi->{'requestid'}); + }
if ($autosimplifylink && !$autosimplifylink->{'rev'}) { my $isbranch = grep {(keys %$_)[0] eq 'branch'} @{$autosimplifylink->{'patches'}->{''} || []}; @@ -5331,7 +5338,7 @@ 'POST:/source/$project/$package cmd=linkdiff rev? linkrev? unified:bool?' => \&linkdiff, 'POST:/source/$project/$package cmd=commit rev? user:? comment:? keeplink:bool? repairlink:bool? linkrev? noservice:bool?' => \&sourcecommit, 'POST:/source/$project/$package cmd=commitfilelist rev? user:? comment:? keeplink:bool? repairlink:bool? linkrev? noservice:bool? requestid:num?' => \&sourcecommitfilelist, - 'POST:/source/$project/$package cmd=copy rev? user:? comment:? orev:rev? oproject:project? opackage:package? expand:bool? keeplink:bool? repairlink:bool? linkrev? olinkrev:linkrev? requestid:num? dontupdatesource:bool?' => \&sourcecopy, + 'POST:/source/$project/$package cmd=copy rev? user:? comment:? orev:rev? oproject:project? opackage:package? expand:bool? keeplink:bool? repairlink:bool? linkrev? olinkrev:linkrev? requestid:num? dontupdatesource:bool? keephist:bool?' => \&sourcecopy, 'POST:/source/$project/$package cmd=branch rev? user:? comment:? orev:rev? oproject:project? opackage:package? olinkrev:linkrev? force:bool?' => \&sourcebranch, 'POST:/source/$project/$package cmd=linktobranch rev? user:? comment:? linkrev?' => \&linktobranch, 'POST:/source/$project/$package cmd=deleteuploadrev' => \&deleteuploadrev,
On 2010-12-22, at 3:41 PM, Anas Nashif wrote:
Hi, Is there an easy way to move packages while maintaining the source change history and the release.build numbers?
Anas-- 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
-- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Hello, Just reporting all jobs on build21 (x86_64) and build23 (x86_64) stalled 24 jobs in total. Glenn -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Am Donnerstag, 6. Januar 2011, 00:25:37 schrieb doiggl@velocitynet.com.au:
Hello, Just reporting all jobs on build21 (x86_64) and build23 (x86_64) stalled 24 jobs in total.
Yes, we have a XEN configuration problem, we are currently looking into it. -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Hello, Just reporting all jobs on build27 (x86_64) stalled 14 jobs in total. It happened before on another service [1]. [1] http://lists.opensuse.org/opensuse-buildservice/2011-01/msg00016.html Glenn -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Am Mittwoch, 12. Januar 2011, 19:08:33 schrieb doiggl@velocitynet.com.au:
Hello, Just reporting all jobs on build27 (x86_64) stalled 14 jobs in total. It happened before on another service [1]. [1] http://lists.opensuse.org/opensuse-buildservice/2011-01/msg00016.html
Thanks, we observe this atm. build27 got restarted. bye adrian -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Am Mittwoch, 5. Januar 2011, 12:03:03 schrieb Anas Nashif:
any comments on this? Or is it so bad and not work commenting on? :)
hm, seems not to be complete to me. The api needs to create a new object, when you move it to a place where it does not exist. Maybe it would need to take over flags also. Also some more data in the backend would need to added, like doing a commit and cloning the build counters. happy new year adrian
Anas
On 2010-12-23, at 1:39 AM, Anas Nashif wrote:
Hi,
so I gave it a try, spent 15 minutes and came up with this patch, which works for me (against 2.1 branch) :-) It is too easy to be true.
(of course this patch is missing the API changes which add keephist, but that is even more easier).
Any feedback? Anas
+++ /usr/lib/obs/server/bs_srcserver 2010-12-22 17:24:38.339160313 -0800 @@ -3657,7 +3657,14 @@
copyfiles($projid, $packid, $oprojid, $opackid, $files);
$files = keeplink($cgi, $projid, $packid, $files) if $cgi->{'keeplink'};
- my $rev = addrev($projid, $packid, $files, $cgi->{'user'}, $cgi->{'comment'}, $cgi->{'rev'}, $cgi->{'requestid'}); + my $rev; + if ( $cgi->{'keephist'} && !getrev($projid, $packid, 'latest')->{'rev'}) { + my @res = BSFileDB::fdb_getall("$projectsdir/$oprojid.pkg/$opackid.rev", $srcrevlay ); + BSFileDB::fdb_add_multiple("$projectsdir/$projid.pkg/$packid.rev", $srcrevlay, @res); + $rev = $orev; + } else { + $rev = addrev($projid, $packid, $files, $cgi->{'user'}, $cgi->{'comment'}, $cgi->{'rev'}, $cgi->{'requestid'}); + }
if ($autosimplifylink && !$autosimplifylink->{'rev'}) {
my $isbranch = grep {(keys %$_)[0] eq 'branch'} @{$autosimplifylink->{'patches'}->{''} || []};
@@ -5331,7 +5338,7 @@
'POST:/source/$project/$package cmd=linkdiff rev? linkrev? unified:bool?' => \&linkdiff, 'POST:/source/$project/$package cmd=commit rev? user:? comment:? keeplink:bool? repairlink:bool? linkrev? noservice:bool?' => \&sourcecommit, 'POST:/source/$project/$package cmd=commitfilelist rev? user:? comment:? keeplink:bool? repairlink:bool? linkrev? noservice:bool? requestid:num?' => \&sourcecommitfilelist,
- 'POST:/source/$project/$package cmd=copy rev? user:? comment:? orev:rev? oproject:project? opackage:package? expand:bool? keeplink:bool? repairlink:bool? linkrev? olinkrev:linkrev? requestid:num? dontupdatesource:bool?' => \&sourcecopy, + 'POST:/source/$project/$package cmd=copy rev? user:? comment:? orev:rev? oproject:project? opackage:package? expand:bool? keeplink:bool? repairlink:bool? linkrev? olinkrev:linkrev? requestid:num? dontupdatesource:bool? keephist:bool?' => \&sourcecopy,
'POST:/source/$project/$package cmd=branch rev? user:? comment:? orev:rev? oproject:project? opackage:package? olinkrev:linkrev? force:bool?' => \&sourcebranch, 'POST:/source/$project/$package cmd=linktobranch rev? user:? comment:? linkrev?' => \&linktobranch, 'POST:/source/$project/$package cmd=deleteuploadrev' => \&deleteuploadrev,
On 2010-12-22, at 3:41 PM, Anas Nashif wrote:
Hi, Is there an easy way to move packages while maintaining the source change history and the release.build numbers?
Anas-- 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
-- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2011-01-05, at 4:22 PM, Adrian Schröter wrote:
Am Mittwoch, 5. Januar 2011, 12:03:03 schrieb Anas Nashif:
any comments on this? Or is it so bad and not work commenting on? :)
hm, seems not to be complete to me. The api needs to create a new object, when you move it to a place where it does not exist. Maybe it would need to take over flags also.
All of this is done just like any other 'copypac' operation, the only difference is the revision file, which instead of starting from 0 will have the history from the source package.
Also some more data in the backend would need to added, like doing a commit and cloning the build counters.
That is what the patch below does. Anas
happy new year adrian
Anas
On 2010-12-23, at 1:39 AM, Anas Nashif wrote:
Hi,
so I gave it a try, spent 15 minutes and came up with this patch, which works for me (against 2.1 branch) :-) It is too easy to be true.
(of course this patch is missing the API changes which add keephist, but that is even more easier).
Any feedback? Anas
+++ /usr/lib/obs/server/bs_srcserver 2010-12-22 17:24:38.339160313 -0800 @@ -3657,7 +3657,14 @@
copyfiles($projid, $packid, $oprojid, $opackid, $files);
$files = keeplink($cgi, $projid, $packid, $files) if $cgi->{'keeplink'};
- my $rev = addrev($projid, $packid, $files, $cgi->{'user'}, $cgi->{'comment'}, $cgi->{'rev'}, $cgi->{'requestid'}); + my $rev; + if ( $cgi->{'keephist'} && !getrev($projid, $packid, 'latest')->{'rev'}) { + my @res = BSFileDB::fdb_getall("$projectsdir/$oprojid.pkg/$opackid.rev", $srcrevlay ); + BSFileDB::fdb_add_multiple("$projectsdir/$projid.pkg/$packid.rev", $srcrevlay, @res); + $rev = $orev; + } else { + $rev = addrev($projid, $packid, $files, $cgi->{'user'}, $cgi->{'comment'}, $cgi->{'rev'}, $cgi->{'requestid'}); + }
if ($autosimplifylink && !$autosimplifylink->{'rev'}) {
my $isbranch = grep {(keys %$_)[0] eq 'branch'} @{$autosimplifylink->{'patches'}->{''} || []};
@@ -5331,7 +5338,7 @@
'POST:/source/$project/$package cmd=linkdiff rev? linkrev? unified:bool?' => \&linkdiff, 'POST:/source/$project/$package cmd=commit rev? user:? comment:? keeplink:bool? repairlink:bool? linkrev? noservice:bool?' => \&sourcecommit, 'POST:/source/$project/$package cmd=commitfilelist rev? user:? comment:? keeplink:bool? repairlink:bool? linkrev? noservice:bool? requestid:num?' => \&sourcecommitfilelist,
- 'POST:/source/$project/$package cmd=copy rev? user:? comment:? orev:rev? oproject:project? opackage:package? expand:bool? keeplink:bool? repairlink:bool? linkrev? olinkrev:linkrev? requestid:num? dontupdatesource:bool?' => \&sourcecopy, + 'POST:/source/$project/$package cmd=copy rev? user:? comment:? orev:rev? oproject:project? opackage:package? expand:bool? keeplink:bool? repairlink:bool? linkrev? olinkrev:linkrev? requestid:num? dontupdatesource:bool? keephist:bool?' => \&sourcecopy,
'POST:/source/$project/$package cmd=branch rev? user:? comment:? orev:rev? oproject:project? opackage:package? olinkrev:linkrev? force:bool?' => \&sourcebranch, 'POST:/source/$project/$package cmd=linktobranch rev? user:? comment:? linkrev?' => \&linktobranch, 'POST:/source/$project/$package cmd=deleteuploadrev' => \&deleteuploadrev,
On 2010-12-22, at 3:41 PM, Anas Nashif wrote:
Hi, Is there an easy way to move packages while maintaining the source change history and the release.build numbers?
Anas-- 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
-- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de
-- 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
On Wed, Jan 05, 2011 at 12:03:03PM +0000, Anas Nashif wrote:
any comments on this? Or is it so bad and not work commenting on? :)
No, but it's the first week in the new year and we're not running at our usual speed ;-)
+++ /usr/lib/obs/server/bs_srcserver 2010-12-22 17:24:38.339160313 -0800 @@ -3657,7 +3657,14 @@ copyfiles($projid, $packid, $oprojid, $opackid, $files);
$files = keeplink($cgi, $projid, $packid, $files) if $cgi->{'keeplink'}; - my $rev = addrev($projid, $packid, $files, $cgi->{'user'}, $cgi->{'comment'}, $cgi->{'rev'}, $cgi->{'requestid'}); + my $rev; + if ( $cgi->{'keephist'} && !getrev($projid, $packid, 'latest')->{'rev'}) { + my @res = BSFileDB::fdb_getall("$projectsdir/$oprojid.pkg/$opackid.rev", $srcrevlay ); + BSFileDB::fdb_add_multiple("$projectsdir/$projid.pkg/$packid.rev", $srcrevlay, @res); + $rev = $orev; + } else { + $rev = addrev($projid, $packid, $files, $cgi->{'user'}, $cgi->{'comment'}, $cgi->{'rev'}, $cgi->{'requestid'}); + }
There are two reasons why it makes sense to do the addrev() also in the keephist case: - to document the action in the source history - to make sure the checkin count is increased, so that packages built with the copied source get a higher revision. (That's because you can't copy the rebuild counters on the repo servers) 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 2011-01-05, at 4:26 PM, Michael Schroeder wrote:
On Wed, Jan 05, 2011 at 12:03:03PM +0000, Anas Nashif wrote:
any comments on this? Or is it so bad and not work commenting on? :)
No, but it's the first week in the new year and we're not running at our usual speed ;-)
Aha, thought so :)
+++ /usr/lib/obs/server/bs_srcserver 2010-12-22 17:24:38.339160313 -0800 @@ -3657,7 +3657,14 @@ copyfiles($projid, $packid, $oprojid, $opackid, $files);
$files = keeplink($cgi, $projid, $packid, $files) if $cgi->{'keeplink'}; - my $rev = addrev($projid, $packid, $files, $cgi->{'user'}, $cgi->{'comment'}, $cgi->{'rev'}, $cgi->{'requestid'}); + my $rev; + if ( $cgi->{'keephist'} && !getrev($projid, $packid, 'latest')->{'rev'}) { + my @res = BSFileDB::fdb_getall("$projectsdir/$oprojid.pkg/$opackid.rev", $srcrevlay ); + BSFileDB::fdb_add_multiple("$projectsdir/$projid.pkg/$packid.rev", $srcrevlay, @res); + $rev = $orev; + } else { + $rev = addrev($projid, $packid, $files, $cgi->{'user'}, $cgi->{'comment'}, $cgi->{'rev'}, $cgi->{'requestid'}); + }
There are two reasons why it makes sense to do the addrev() also in the keephist case:
- to document the action in the source history - to make sure the checkin count is increased, so that packages built with the copied source get a higher revision. (That's because you can't copy the rebuild counters on the repo servers)
Ok, I agree, I will add that and will submit a proper patch :) Anas
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 (5)
-
Adrian Schröter
-
Anas Nashif
-
doiggl@velocitynet.com.au
-
Martin Mohring
-
Michael Schroeder