summaryrefslogtreecommitdiffstats
path: root/perl-install/pkgs.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r--perl-install/pkgs.pm21
1 files changed, 20 insertions, 1 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 9cc164435..550e4cc26 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -200,6 +200,10 @@ sub packagesOfMedium {
my $medium = $packages->[2]{$mediumName};
grep { $_->{medium} == $medium } @{$packages->[1]};
}
+sub packagesToInstall {
+ my ($packages) = @_;
+ grep { pkgs::packageFlagSelected($_) && !pkgs::packageFlagInstalled($_) } values %{$packages->[0]};
+}
#- selection, unselection of package.
sub selectPackage($$;$$$) {
@@ -907,7 +911,7 @@ sub install($$$;$$) {
c::rpmtransFree($trans);
};
- c::rpmdepOrder($trans) or
+ c::rpmdepOrder($trans) or
cdie "error ordering package list: " . c::rpmErrorString(), sub {
&$close();
c::rpmdbClose($db);
@@ -918,6 +922,21 @@ sub install($$$;$$) {
my @probs = c::rpmRunTransactions($trans, $callbackOpen, $callbackClose, \&installCallback, 0);
log::l("rpmRunTransactions done");
+
+ my @badpkgs = map { $_->{file} } grep { !packageFlagInstalled($_) } @transToInstall;
+ @badpkgs > 0 and
+ cdie _("The following packages have not been installed because of errors: %s", join("\n", @badpkgs)), sub {
+ &$close();
+ c::rpmdbClose($db);
+ };
+ #- check for uninstalled package, avoid keeping them selected to avoid trying installing them
+ foreach (@transToInstall) {
+ if (!packageFlagInstalled($_)) {
+ log::l("bad package $_->{file}");
+ packageSetFlagSelected($_, 0);
+ }
+ }
+
&$close();
log::l("after close");
if (@probs) {