summaryrefslogtreecommitdiffstats
path: root/perl-install/do_pkgs.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-03-08 08:51:08 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-03-08 08:51:08 +0000
commit1bee39ce143a829067fda56d35ee7f97f8890490 (patch)
tree1a8b7612a30f54247868426c381ad09fb1b8aaeb /perl-install/do_pkgs.pm
parent929b798cd06ad5a5c2c7534dd30162baa3d26fad (diff)
downloaddrakx-1bee39ce143a829067fda56d35ee7f97f8890490.tar
drakx-1bee39ce143a829067fda56d35ee7f97f8890490.tar.gz
drakx-1bee39ce143a829067fda56d35ee7f97f8890490.tar.bz2
drakx-1bee39ce143a829067fda56d35ee7f97f8890490.tar.xz
drakx-1bee39ce143a829067fda56d35ee7f97f8890490.zip
(ensure_is_installed_if_availlable) introduce it in order to check if we need
to install a package, then install it if it's availlable (eg: for binary drivers not availlable in download edition)
Diffstat (limited to 'perl-install/do_pkgs.pm')
-rw-r--r--perl-install/do_pkgs.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/perl-install/do_pkgs.pm b/perl-install/do_pkgs.pm
index 05dbdb289..f49f6dcb4 100644
--- a/perl-install/do_pkgs.pm
+++ b/perl-install/do_pkgs.pm
@@ -29,6 +29,13 @@ sub ensure_is_installed {
1;
}
+sub ensure_is_installed_if_availlable {
+ my ($do, $pkg, $file) = @_;
+ if (! -e "$::prefix$file" && !$::testing) {
+ $do->{in}->do_pkgs->what_provides($pkg) and $do->{in}->do_pkgs->install($pkg);
+ }
+}
+
sub is_installed {
my ($do, $name) = @_;
$do->are_installed($name);