From e9ce5e5314d86c0e2e108cdc30c289cdbc3940b8 Mon Sep 17 00:00:00 2001 From: "Thierry.Vignaud" Date: Mon, 26 May 2014 17:40:38 +0200 Subject: podify++ --- perl-install/do_pkgs.pm | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'perl-install/do_pkgs.pm') diff --git a/perl-install/do_pkgs.pm b/perl-install/do_pkgs.pm index 780fe88ad..5e4f3a9b6 100644 --- a/perl-install/do_pkgs.pm +++ b/perl-install/do_pkgs.pm @@ -27,6 +27,14 @@ sub do_pkgs { package do_pkgs_common; use common; +=item ensure_is_installed($do, $pkg, $o_file, $b_auto) + +Makes sure that the $pkg package is installed. +If $o_file is provided, the already installed check is I faster. +If $b_auto is set, (g)urpmi will not ask any questions. + +=cut + sub ensure_is_installed { my ($do, $pkg, $o_file, $b_auto) = @_; @@ -49,6 +57,15 @@ sub ensure_is_installed { 1; } +=item ensure_are_installed($do, $pkgs, $b_auto) + +Makes sure that the packages listed in $pkgs array ref are installed. +If $b_auto is set, (g)urpmi will not ask any questions. + +It's quite costly, so it's better to use the B instead. + +=cut + sub ensure_are_installed { my ($do, $pkgs, $b_auto) = @_; @@ -68,6 +85,14 @@ sub ensure_are_installed { 1; } +=item ensure_binary_is_installed($do, $pkg, $binary, $b_auto) + +Makes sure that the $pkg package is installed. +$binary is looked for in $PATH. If not found, the package is installed. +If $b_auto is set, (g)urpmi will not ask any questions. + +=cut + sub ensure_binary_is_installed { my ($do, $pkg, $binary, $b_auto) = @_; @@ -89,6 +114,7 @@ sub ensure_binary_is_installed { =item ensure_files_are_installed($do, $pkgs, $b_auto) Takes a list of [ "package", "file" ] and installs package if file is not there. +If $b_auto is set, (g)urpmi will not ask any questions. =cut @@ -112,6 +138,12 @@ sub ensure_files_are_installed { 1; } +=item ensure_is_installed_if_available($do, $pkg, $file) = @_; + +Install $pkg if $file is not present and if $pkg is actually known to urpmi. + +=cut + sub ensure_is_installed_if_available { my ($do, $pkg, $file) = @_; if (-e "$::prefix$file" || $::testing) { @@ -121,11 +153,29 @@ sub ensure_is_installed_if_available { } } +=item is_available($do, $name) + +=item are_available($do, @names) + +Returns name(s) of package(s) that are available (aka known to urpmi). +This is somewhat costly (needs to parse urpmi synthesis...) + +=cut + sub is_available { my ($do, $name) = @_; $do->are_available($name); } +=item is_installed($do, $name) + +=item are_installed($do, @names) + +Returns name(s) of package(s) that are already installed on the system. +This is less costly (needs to query rpmdb) + +=cut + sub is_installed { my ($do, $name) = @_; $do->are_installed($name); @@ -169,6 +219,12 @@ use common; our @ISA = qw(do_pkgs_common); +=item new($type, $in) + +Returns a C object. + +=cut + sub new { my ($type, $in) = @_; -- cgit v1.2.1