summaryrefslogtreecommitdiffstats
path: root/perl-install/pkgs.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-04-12 14:40:16 +0000
committerFrancois Pons <fpons@mandriva.com>2000-04-12 14:40:16 +0000
commitf767bf7493bd00eae8719d5c590ef0c7366fe59a (patch)
treee9eda9c1697c3583194632466ec745daf960d097 /perl-install/pkgs.pm
parent270af6008741d1a94b885668072eb5fc51b906bc (diff)
downloaddrakx-f767bf7493bd00eae8719d5c590ef0c7366fe59a.tar
drakx-f767bf7493bd00eae8719d5c590ef0c7366fe59a.tar.gz
drakx-f767bf7493bd00eae8719d5c590ef0c7366fe59a.tar.bz2
drakx-f767bf7493bd00eae8719d5c590ef0c7366fe59a.tar.xz
drakx-f767bf7493bd00eae8719d5c590ef0c7366fe59a.zip
*** empty log message ***
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) {