diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-03-02 13:24:39 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-03-02 13:24:39 +0000 |
commit | cb073c09a8898c6aa217815a5d315e75abdd524f (patch) | |
tree | cb2f9960ba505b1bb2e9cd662fdf24ed46d4dfb8 | |
parent | 9d87037d96299c14bd28f7f4f638c59b1df21df5 (diff) | |
download | rpmdrake-cb073c09a8898c6aa217815a5d315e75abdd524f.tar rpmdrake-cb073c09a8898c6aa217815a5d315e75abdd524f.tar.gz rpmdrake-cb073c09a8898c6aa217815a5d315e75abdd524f.tar.bz2 rpmdrake-cb073c09a8898c6aa217815a5d315e75abdd524f.tar.xz rpmdrake-cb073c09a8898c6aa217815a5d315e75abdd524f.zip |
(perform_installation) reindent
-rwxr-xr-x | Rpmdrake/pkg.pm | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index a5aff768..06f9d327 100755 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -546,7 +546,7 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-( } }; - my ($nok, @rpms_install, @rpms_upgrade); + my ($nok, @rpms_install, @rpms_upgrade); foreach my $set (@{$state->{transaction} || []}) { my (@transaction_list, %transaction_sources); $transaction = $set; @@ -558,48 +558,48 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-( \@transaction_list, \%transaction_sources, \%error_sources, - callback => sub { - my ($mode, $file, $percent) = @_; - if ($mode eq 'start') { - Rpmdrake::gurpm::label(N("Downloading package `%s' (%s/%s)...", - basename($file), ++$distant_progress, $distant_number)); - Rpmdrake::gurpm::validate_cancel(but(N("Cancel")), sub { $canceled = 1 }); - } elsif ($mode eq 'progress') { - Rpmdrake::gurpm::progress($percent/100); - } elsif ($mode eq 'end') { - Rpmdrake::gurpm::progress(1); - Rpmdrake::gurpm::invalidate_cancel(); - } - $canceled and return 'canceled'; - }, - ); - $canceled and goto return_with_error; - Rpmdrake::gurpm::invalidate_cancel_forever(); + callback => sub { + my ($mode, $file, $percent) = @_; + if ($mode eq 'start') { + Rpmdrake::gurpm::label(N("Downloading package `%s' (%s/%s)...", + basename($file), ++$distant_progress, $distant_number)); + Rpmdrake::gurpm::validate_cancel(but(N("Cancel")), sub { $canceled = 1 }); + } elsif ($mode eq 'progress') { + Rpmdrake::gurpm::progress($percent/100); + } elsif ($mode eq 'end') { + Rpmdrake::gurpm::progress(1); + Rpmdrake::gurpm::invalidate_cancel(); + } + $canceled and return 'canceled'; + }, + ); + $canceled and goto return_with_error; + Rpmdrake::gurpm::invalidate_cancel_forever(); my %transaction_sources_install = %{$urpm->extract_packages_to_install(\%transaction_sources, $state) || {}}; push @rpms_install, grep { !/\.src\.rpm$/ } values %transaction_sources_install; push @rpms_upgrade, grep { !/\.src\.rpm$/ } values %transaction_sources; - if (!$::options{'no-verify-rpm'}) { - Rpmdrake::gurpm::label(N("Verifying package signatures...")); - my $total = keys(%transaction_sources_install) + keys %transaction_sources; - my $progress; - my @invalid_sources = urpm::signature::check($urpm, - \%transaction_sources_install, \%transaction_sources, - translate => 1, basename => 1, - callback => sub { - Rpmdrake::gurpm::progress(++$progress/$total); - }, - ); - if (@invalid_sources) { - local $::main_window = $Rpmdrake::gurpm::mainw->{real_window}; - interactive_msg( - N("Warning"), - N("The following packages have bad signatures:\n\n%s\n\nDo you want to continue installation?", - join("\n", sort @invalid_sources)), yesno => 1, if_(@invalid_sources > 10, scroll => 1), - ) or goto return_with_error; + if (!$::options{'no-verify-rpm'}) { + Rpmdrake::gurpm::label(N("Verifying package signatures...")); + my $total = keys(%transaction_sources_install) + keys %transaction_sources; + my $progress; + my @invalid_sources = urpm::signature::check($urpm, + \%transaction_sources_install, \%transaction_sources, + translate => 1, basename => 1, + callback => sub { + Rpmdrake::gurpm::progress(++$progress/$total); + }, + ); + if (@invalid_sources) { + local $::main_window = $Rpmdrake::gurpm::mainw->{real_window}; + interactive_msg( + N("Warning"), + N("The following packages have bad signatures:\n\n%s\n\nDo you want to continue installation?", + join("\n", sort @invalid_sources)), yesno => 1, if_(@invalid_sources > 10, scroll => 1), + ) or goto return_with_error; + } } - } #- check for local files. if (my @missing = grep { m|^/| && ! -e $_ } values %transaction_sources_install, values %transaction_sources) { @@ -666,8 +666,8 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-( push @errors, @l; } else { interactive_msg(N("Error"), - N("Installation failed:") . "\n" . join("\n", map { "\t$_" } @l) . "\n\n" . - N("Try harder to install (--force)? (y/N) "), + N("Installation failed:") . "\n" . join("\n", map { "\t$_" } @l) . "\n\n" . + N("Try harder to install (--force)? (y/N) "), yesno => 1 ) or ++$nok, next; $urpm->{log}("starting force installing packages without deps"); |