From 8e2ba0720ea2a41ef48fa5abcb05db2b01afcf97 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20P=C3=ADsa=C5=99?= Date: Wed, 21 Jan 2015 14:24:13 +0100 Subject: [PATCH] Remove first $mode argument from waitforbuildroot() and descendants The mode is part of Config argument, so it was redundant and thus removed. --- lib/Fedora/Rebuild.pm | 2 +- lib/Fedora/Rebuild/Package.pm | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/Fedora/Rebuild.pm b/lib/Fedora/Rebuild.pm index 307c3ae..72b8a4c 100644 --- a/lib/Fedora/Rebuild.pm +++ b/lib/Fedora/Rebuild.pm @@ -658,7 +658,7 @@ sub run { foreach my $package (@packages) { my $job = $scheduler->schedule($package->can('waitforbuildroot'), - $package, $self->mode, $self->build_config); + $package, $self->build_config); if (! defined $job) { next; } $jobs{$job} = $package; my %finished = $scheduler->finish(++$i < @packages); diff --git a/lib/Fedora/Rebuild/Package.pm b/lib/Fedora/Rebuild/Package.pm index 1afe755..ba0c8b5 100644 --- a/lib/Fedora/Rebuild/Package.pm +++ b/lib/Fedora/Rebuild/Package.pm @@ -1066,15 +1066,15 @@ sub build { # Waits for build root rotation. Just built package will be available for # other packages at build time after returning from this fuction. -# If first argument is "koji", it will wait for the Koji rotation. -# If first argument is "mock", it will create yum repository in directory with +# First argument is Fedora::Rebuild::Package::Config object. +# If the mode is "koji", it will wait for the Koji rotation. +# If the mode is "mock", it will create yum repository in directory with # binary packages. -# If first argument is "local", this function is void, -# Second argument is Fedora::Rebuild::Package::Config object. +# If the mode is "local", this function is void. # Requires `update'. Sould be called after `build'. # Return true on success. sub dowaitforbuildroot { - my ($self, $mode, $build_config) = @_; + my ($self, $build_config) = @_; my $lock = Fedora::Rebuild::Package::StateLock->new(package => $self, state => 'rotate'); if ($lock->is_done) { return 1; } @@ -1084,7 +1084,7 @@ sub dowaitforbuildroot { return $lock->mark_failed; } - if ($mode eq 'koji') { + if ($build_config->mode() eq 'koji') { if (!$lock->do($self->repodir, 'koji', 'wait-repo', '--build=' . $nevra, '--target', $self->target)) { $lock->log("Koji does not contain `" . $nevra . @@ -1092,7 +1092,7 @@ sub dowaitforbuildroot { "' build target yet.\n"); return $lock->mark_failed; } - } elsif ($mode eq 'mock') { + } elsif ($build_config->mode() eq 'mock') { $lock->log("`" . $nevra . "' built in mock, creating yum repository...\n"); if (!$lock->do($self->rpmdir, 'createrepo_c', '.')) { @@ -1261,16 +1261,16 @@ sub rebuild { } # Wait for the package propagated into new build root. -# If first argument is "koji", waits for Koji build root rotation, +# First argument is Fedora::Rebuild::Package::Config object. +# If the mode is "koji", waits for Koji build root rotation, # Otherwise waits locally (no-op). -# Second argument is Fedora::Rebuild::Package::Config object. # XXX: Requires `update', should be called after rebuilding package. sub waitforbuildroot { - my ($self, $mode, $build_config) = @_; + my ($self, $build_config) = @_; my $ok; print "Waiting for `" . $self->name . "' to get to build root...\n"; - $ok = $self->dowaitforbuildroot($mode, $build_config); + $ok = $self->dowaitforbuildroot($build_config); if ($ok) { print "`" . $self->name . "' propagated successfully.\n"; -- 2.11.4.GIT