6 use FindBin; # we need to enforce which C4::Installer is used in case more than one is installed
10 use C4::Installer::PerlModules;
24 'm|missing' => \$missing,
25 'i|installed' => \$installed,
26 'u|upgrade' => \$upgrade,
31 pod2usage(1) if $help || (!$missing && !$installed && !$upgrade && !$all);
33 my $koha_pm = C4::Installer::PerlModules->new;
34 $koha_pm->version_info(all => 1);
38 push @pm, 'missing_pm' if $missing || $all;
39 push @pm, 'upgrade_pm' if $upgrade || $all;
40 push @pm, 'current_pm' if $installed || $all;
42 print color 'bold blue' if $color;
44 Installed Required Module is
45 Module Name Version Version Required
46 --------------------------------------------------------------------------------------------
50 foreach my $type (@pm) {
52 $mod_type =~ s/_pm$//;
53 my $pm = $koha_pm->get_attr($type);
55 foreach my $pm (keys(%$_)) {
56 print color 'yellow' if $type eq 'upgrade_pm' && $color;
57 print color 'red' if $type eq 'missing_pm' && $color;
58 print color 'green' if $type eq 'current_pm' && $color;
60 my $required = ($_->{$pm}->{'required'}?'Yes':'No');
61 my $current_version = ($color ? $_->{$pm}->{'cur_ver'} :
62 $type eq 'missing_pm' || $type eq 'upgrade_pm' ? $_->{$pm}->{'cur_ver'}." *" : $_->{$pm}->{'cur_ver'});
64 @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<< @<<<<<
65 $pm, $current_version, $_->{$pm}->{'min_ver'}, $required
71 print color 'bold blue' if $color;
73 --------------------------------------------------------------------------------------------
74 Total modules reported: $count ";
80 $footer .= "* Module is missing or requires an upgrade.\n\n";
84 print color 'reset' if $color;
96 ./koha_perl_deps.pl -m
102 =item B<-m|--missing>
104 lists all missing perl modules
106 =item B<-i|--installed>
108 lists all installed perl modules
110 =item B<-u|--upgrade>
112 lists all perl modules needing to be upgraded relative to Koha
116 lists all koha perl dependencies
120 formats the output in color; red = module is missing, yellow = module requires upgrading, green = module is installed and current
124 prints this help text
130 Chris Nighswonger <cnighswonger AT foundations DOT edu>
134 Copyright 2010 Foundations Bible College.
138 This file is part of Koha.
140 Koha is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software
141 Foundation; either version 2 of the License, or (at your option) any later version.
143 You should have received a copy of the GNU General Public License along
144 with Koha; if not, write to the Free Software Foundation, Inc.,
145 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
147 =head1 DISCLAIMER OF WARRANTY
149 Koha is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
150 A PARTICULAR PURPOSE. See the GNU General Public License for more details.