Skip to content

Commit

Permalink
[backend] support 'expanddebug' element in buildinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Nov 14, 2012
1 parent 26fd1f4 commit 9ee8a5a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/backend/BSXML.pm
Expand Up @@ -521,6 +521,7 @@ our $buildinfo = [
'repository',
'server',
]],
'expanddebug',
];

our $jobstatus = [
Expand Down
5 changes: 5 additions & 0 deletions src/backend/bs_repserver
Expand Up @@ -2384,6 +2384,7 @@ sub getbuildinfo {
unshift @deps, @{$info->{'dep'} || []};

# expand deps
$ret->{'expanddebug'} = '' if $cgi->{'debug'};
$Build::expand_dbg = 1 if $cgi->{'debug'};
@subpacks = () if $packtype eq 'kiwi';
my @edeps;
Expand All @@ -2405,6 +2406,7 @@ sub getbuildinfo {
@edeps = Build::get_deps($bconf, \@subpacks, @deps);
$bconf->{'ignore'} = $bconfignore if $bconfignore;
$bconf->{'ignoreh'} = $bconfignoreh if $bconfignoreh;
$ret->{'expanddebug'} .= $xp->debugstr() if defined($ret->{'expanddebug'}) && defined &BSSolv::expander::debugstr;
} else {
my $xp = BSSolv::expander->new($pool, $bconf);
my $ownexpand = sub {
Expand All @@ -2415,6 +2417,7 @@ sub getbuildinfo {
local *Build::expand = $ownexpand;
use warnings 'redefine';
@edeps = Build::get_deps($bconf, \@subpacks, @deps);
$ret->{'expanddebug'} .= $xp->debugstr() if defined($ret->{'expanddebug'}) && defined &BSSolv::expander::debugstr;
}
undef $Build::expand_dbg if $cgi->{'debug'};
if (! shift @edeps) {
Expand Down Expand Up @@ -2471,6 +2474,8 @@ sub getbuildinfo {
}
undef $xp;
undef $Build::expand_dbg if $cgi->{'debug'};
$ret->{'expanddebug'} .= "\n" if $ret->{'expanddebug'};
$ret->{'expanddebug'} .= $xp->debugstr() if defined($ret->{'expanddebug'}) && defined &BSSolv::expander::debugstr;
if (! shift @bdeps) {
$ret->{'error'} = "unresolvable: ".join(', ', @bdeps);
return ($ret, $BSXML::buildinfo);
Expand Down
6 changes: 4 additions & 2 deletions src/backend/bs_srcserver
Expand Up @@ -5523,6 +5523,7 @@ sub getbuildinfo {
checkprojrepoarch($projid, $repoid, $arch);
my @args;
push @args, 'internal=1' if $cgi->{'internal'};
push @args, 'debug=1' if $cgi->{'debug'};
push @args, map {"add=$_"} @{$cgi->{'add'} || []};
my $buildinfo = BSWatcher::rpc("$BSConfig::reposerver/build/$projid/$repoid/$arch/$packid/_buildinfo", $BSXML::buildinfo, @args);
return ($buildinfo, $BSXML::buildinfo);
Expand All @@ -5532,6 +5533,7 @@ sub getbuildinfo_post {
my ($cgi, $projid, $repoid, $arch, $packid) = @_;
checkprojrepoarch($projid, $repoid, $arch);
my @args;
push @args, 'debug=1' if $cgi->{'debug'};
push @args, map {"add=$_"} @{$cgi->{'add'} || []};
my $param = {
'uri' => "$BSConfig::reposerver/build/$projid/$repoid/$arch/$packid/_buildinfo",
Expand Down Expand Up @@ -7182,8 +7184,8 @@ my $dispatches = [
'POST:/build/$project/$repository/$arch/$package cmd=copy oproject:project? opackage:package? orepository:repository? setupdateinfoid:? resign:bool?' => \&copybuild,
'POST:/build/$project/$repository/$arch/$package' => \&uploadbuild,
'/build/$project/$repository/$arch/$package_repository view:? binary:filename* nometa:bool?' => \&getbinarylist,
'POST:/build/$project/$repository/$arch/$package_repository/_buildinfo add:*' => \&getbuildinfo_post,
'/build/$project/$repository/$arch/$package/_buildinfo add:* internal:bool?' => \&getbuildinfo,
'POST:/build/$project/$repository/$arch/$package_repository/_buildinfo add:* debug:bool?' => \&getbuildinfo_post,
'/build/$project/$repository/$arch/$package/_buildinfo add:* internal:bool? debug:bool?' => \&getbuildinfo,
'/build/$project/$repository/$arch/$package/_log nostream:bool? start:intnum? end:num? view:?' => \&getlogfile,
'/build/$project/$repository/$arch/$package/_reason' => \&getbuildreason,
'/build/$project/$repository/$arch/$package/_status' => \&getbuildstatus,
Expand Down

0 comments on commit 9ee8a5a

Please sign in to comment.