Lines 18-23
my $installed = 0;
Link Here
|
18 |
my $upgrade = 0; |
18 |
my $upgrade = 0; |
19 |
my $all = 0; |
19 |
my $all = 0; |
20 |
my $color = 0; |
20 |
my $color = 0; |
|
|
21 |
my $brief = 0; |
22 |
my $req = 0; |
21 |
|
23 |
|
22 |
GetOptions( |
24 |
GetOptions( |
23 |
'h|help|?' => \$help, |
25 |
'h|help|?' => \$help, |
Lines 25-30
GetOptions(
Link Here
|
25 |
'i|installed' => \$installed, |
27 |
'i|installed' => \$installed, |
26 |
'u|upgrade' => \$upgrade, |
28 |
'u|upgrade' => \$upgrade, |
27 |
'a|all' => \$all, |
29 |
'a|all' => \$all, |
|
|
30 |
'b|brief' => \$brief, |
31 |
'r|required' => \$req, |
28 |
'c|color' => \$color, |
32 |
'c|color' => \$color, |
29 |
); |
33 |
); |
30 |
|
34 |
|
Lines 39-50
push @pm, 'missing_pm' if $missing || $all;
Link Here
|
39 |
push @pm, 'upgrade_pm' if $upgrade || $all; |
43 |
push @pm, 'upgrade_pm' if $upgrade || $all; |
40 |
push @pm, 'current_pm' if $installed || $all; |
44 |
push @pm, 'current_pm' if $installed || $all; |
41 |
|
45 |
|
42 |
print color 'bold blue' if $color; |
46 |
if (!$brief) { |
43 |
print" |
47 |
print color 'bold blue' if $color; |
|
|
48 |
print" |
44 |
Installed Required Module is |
49 |
Installed Required Module is |
45 |
Module Name Version Version Required |
50 |
Module Name Version Version Required |
46 |
-------------------------------------------------------------------------------------------- |
51 |
-------------------------------------------------------------------------------------------- |
47 |
"; |
52 |
"; |
|
|
53 |
} |
48 |
|
54 |
|
49 |
my $count = 0; |
55 |
my $count = 0; |
50 |
foreach my $type (@pm) { |
56 |
foreach my $type (@pm) { |
Lines 60-87
foreach my $type (@pm) {
Link Here
|
60 |
my $required = ($_->{$pm}->{'required'}?'Yes':'No'); |
66 |
my $required = ($_->{$pm}->{'required'}?'Yes':'No'); |
61 |
my $current_version = ($color ? $_->{$pm}->{'cur_ver'} : |
67 |
my $current_version = ($color ? $_->{$pm}->{'cur_ver'} : |
62 |
$type eq 'missing_pm' || $type eq 'upgrade_pm' ? $_->{$pm}->{'cur_ver'}." *" : $_->{$pm}->{'cur_ver'}); |
68 |
$type eq 'missing_pm' || $type eq 'upgrade_pm' ? $_->{$pm}->{'cur_ver'}." *" : $_->{$pm}->{'cur_ver'}); |
|
|
69 |
if (!$brief) { |
70 |
if (($req && $required eq 'Yes') || !$req) { |
63 |
format = |
71 |
format = |
64 |
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<< @<<<<< |
72 |
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<< @<<<<< |
65 |
$pm, $current_version, $_->{$pm}->{'min_ver'}, $required |
73 |
$pm, $current_version, $_->{$pm}->{'min_ver'}, $required |
66 |
. |
74 |
. |
67 |
write; |
75 |
write; |
|
|
76 |
} |
77 |
} |
78 |
else { |
79 |
if (($req && $required eq 'Yes') || !$req) { |
80 |
print "$pm\n"; |
81 |
} |
82 |
} |
68 |
} |
83 |
} |
69 |
} |
84 |
} |
70 |
} |
85 |
} |
71 |
print color 'bold blue' if $color; |
86 |
|
72 |
my $footer = " |
87 |
if (!$brief) { |
|
|
88 |
print color 'bold blue' if $color; |
89 |
my $footer = " |
73 |
-------------------------------------------------------------------------------------------- |
90 |
-------------------------------------------------------------------------------------------- |
74 |
Total modules reported: $count "; |
91 |
Total modules reported: $count "; |
75 |
|
92 |
|
76 |
if ($color) { |
93 |
if ($color) { |
77 |
$footer .= "\n\n"; |
94 |
$footer .= "\n\n"; |
78 |
} |
95 |
} |
79 |
else { |
96 |
else { |
80 |
$footer .= "* Module is missing or requires an upgrade.\n\n"; |
97 |
$footer .= "* Module is missing or requires an upgrade.\n\n"; |
81 |
} |
98 |
} |
82 |
|
99 |
|
83 |
print $footer; |
100 |
print $footer; |
84 |
print color 'reset' if $color; |
101 |
print color 'reset' if $color; |
|
|
102 |
} |
85 |
|
103 |
|
86 |
1; |
104 |
1; |
87 |
|
105 |
|
Lines 93-99
koha_perl_deps.pl
Link Here
|
93 |
|
111 |
|
94 |
=head1 SYNOPSIS |
112 |
=head1 SYNOPSIS |
95 |
|
113 |
|
96 |
./koha_perl_deps.pl -m |
114 |
At least one of -a, -m, -i, or -u flags must specified to not trigger help. |
|
|
115 |
./koha_perl_deps.pl -m [-b] [-r] [-c] |
116 |
./koha_perl_deps.pl -u [-b] [-r] [-c] |
117 |
./koha_perl_deps.pl -i [-b] [-r] [-c] |
118 |
./koha_perl_deps.pl -a [-b] [-r] [-c] |
119 |
./koha_perl_deps.pl [-[h?]] |
97 |
|
120 |
|
98 |
=head1 OPTIONS |
121 |
=head1 OPTIONS |
99 |
|
122 |
|
Lines 113-119
lists all perl modules needing to be upgraded relative to Koha
Link Here
|
113 |
|
136 |
|
114 |
=item B<-a|--all> |
137 |
=item B<-a|--all> |
115 |
|
138 |
|
116 |
lists all koha perl dependencies |
139 |
lists all koha perl dependencies |
|
|
140 |
This is equivalent to '-m -i -u'. |
141 |
|
142 |
=item B<-b|--brief> |
143 |
|
144 |
lists only the perl dependency name. |
145 |
|
146 |
=item B<-r|--required> |
147 |
|
148 |
filters list to only required perl dependencies. |
117 |
|
149 |
|
118 |
=item B<-c|--color> |
150 |
=item B<-c|--color> |
119 |
|
151 |
|
120 |
- |
|
|