|
Lines 3-23
Link Here
|
| 3 |
# Write dependency list from Koha PerlDependencies.pm, in Debian format. |
3 |
# Write dependency list from Koha PerlDependencies.pm, in Debian format. |
| 4 |
# |
4 |
# |
| 5 |
# Copyright 2010 Catalyst IT, Ltd |
5 |
# Copyright 2010 Catalyst IT, Ltd |
| 6 |
# |
6 |
# |
| 7 |
# This program is free software: you can redistribute it and/or modify |
7 |
# This program is free software: you can redistribute it and/or modify |
| 8 |
# it under the terms of the GNU General Public License as published by |
8 |
# it under the terms of the GNU General Public License as published by |
| 9 |
# the Free Software Foundation, either version 3 of the License, or |
9 |
# the Free Software Foundation, either version 3 of the License, or |
| 10 |
# (at your option) any later version. |
10 |
# (at your option) any later version. |
| 11 |
# |
11 |
# |
| 12 |
# This program is distributed in the hope that it will be useful, |
12 |
# This program is distributed in the hope that it will be useful, |
| 13 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
# GNU General Public License for more details. |
15 |
# GNU General Public License for more details. |
| 16 |
# |
16 |
# |
| 17 |
# You should have received a copy of the GNU General Public License |
17 |
# You should have received a copy of the GNU General Public License |
| 18 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
|
19 |
|
| 20 |
|
|
|
| 21 |
use strict; |
20 |
use strict; |
| 22 |
use warnings; |
21 |
use warnings; |
| 23 |
|
22 |
|
|
Lines 26-68
use C4::Installer::PerlDependencies;
Link Here
|
| 26 |
# These are packages that may not be in the apt archive in a way that |
25 |
# These are packages that may not be in the apt archive in a way that |
| 27 |
# apt-file can find, e.g. in the Koha repo rather than the regular |
26 |
# apt-file can find, e.g. in the Koha repo rather than the regular |
| 28 |
# debian one. |
27 |
# debian one. |
| 29 |
my %overrides = ( |
28 |
my %overrides = (); |
| 30 |
'CGI::Session::Driver::memcached' => 'libcgi-session-driver-memcached-perl', |
29 |
|
| 31 |
'CHI' => 'libchi-perl', |
30 |
# These are packages we're going to ignore |
| 32 |
'CHI::Driver::Memcached' => 'libchi-driver-memcached-perl', |
31 |
my %ignore = ( |
| 33 |
'Template::Plugin::HtmlToText' => 'libtemplate-plugin-htmltotext-perl', |
32 |
'Data::Pagination' => 1, |
|
|
33 |
'CHI' => 1, |
| 34 |
'CHI::Driver::Memcached' => 1, |
| 34 |
); |
35 |
); |
| 35 |
|
36 |
|
| 36 |
my $deps = $C4::Installer::PerlDependencies::PERL_DEPS; |
37 |
my $deps = $C4::Installer::PerlDependencies::PERL_DEPS; |
| 37 |
|
38 |
|
| 38 |
my $prefix = "^/usr/((lib|share)/perl5|(lib|share)/perl/[0-9.]+)"; |
39 |
my $prefix = "^/usr/((lib|share)/perl5|(lib|share)/perl/[0-9.]+)"; |
| 39 |
|
40 |
|
| 40 |
foreach my $module (keys %$deps) { |
41 |
foreach my $module ( keys %$deps ) { |
| 41 |
my $ver = $deps->{$module}->{'min_ver'}; |
42 |
next if $ignore{$module}; |
|
|
43 |
my $ver = $deps->{$module}->{'min_ver'}; |
| 42 |
my $subpath = $module; |
44 |
my $subpath = $module; |
| 43 |
$subpath =~ s,::,/,g; |
45 |
$subpath =~ s,::,/,g; |
| 44 |
my $output = |
46 |
my $output = qx(apt-file -l -x search "$prefix/$subpath.pm\$"); |
| 45 |
qx(apt-file -l -x search "$prefix/$subpath.pm\$"); |
47 |
my @temp = split( /\n/, $output ); |
| 46 |
my @temp = split(/\n/, $output); |
48 |
my @lines = (); |
| 47 |
my @lines = (); |
49 |
|
| 48 |
# Remove packages that are required/essential and always installed on |
50 |
# Remove packages that are required/essential and always installed on |
| 49 |
# a Debian system. Debian packages should not have unversioned |
51 |
# a Debian system. Debian packages should not have unversioned |
| 50 |
# dependencies on such packages. |
52 |
# dependencies on such packages. |
| 51 |
foreach my $line (@temp) { |
53 |
foreach my $line (@temp) { |
| 52 |
if ($line ne "perl-base") { |
54 |
if ( $line ne "perl-base" ) { |
| 53 |
@lines = (@lines, $line); |
55 |
@lines = ( @lines, $line ); |
| 54 |
} |
56 |
} |
| 55 |
} |
57 |
} |
| 56 |
if (scalar(@lines) == 1 && $lines[0] ne "") { |
58 |
if ( scalar(@lines) == 1 && $lines[0] ne "" ) { |
| 57 |
my $pkg = $lines[0]; |
59 |
my $pkg = $lines[0]; |
| 58 |
print "$pkg\n"; |
60 |
print "$pkg\n"; |
| 59 |
} elsif (scalar(@lines) > 1) { |
61 |
} |
|
|
62 |
elsif ( scalar(@lines) > 1 ) { |
| 60 |
foreach my $pkg (@lines) { |
63 |
foreach my $pkg (@lines) { |
| 61 |
print " | " if ($pkg ne $lines[0]); |
64 |
print " | " if ( $pkg ne $lines[0] ); |
| 62 |
print "$pkg"; |
65 |
print "$pkg"; |
| 63 |
} |
66 |
} |
| 64 |
print "\n"; |
67 |
print "\n"; |
| 65 |
} elsif (scalar(@temp) != 0) { |
68 |
} |
|
|
69 |
elsif ( scalar(@temp) != 0 ) { |
| 70 |
|
| 66 |
# I'm an Essential and I'm OK, |
71 |
# I'm an Essential and I'm OK, |
| 67 |
# I install all night, and work all day. |
72 |
# I install all night, and work all day. |
| 68 |
# I chomp up strings. I eat my bugs. |
73 |
# I chomp up strings. I eat my bugs. |
|
Lines 74-82
foreach my $module (keys %$deps) {
Link Here
|
| 74 |
# is no reason to be suspicious of this |
79 |
# is no reason to be suspicious of this |
| 75 |
# commit.) |
80 |
# commit.) |
| 76 |
# RM note: suspicious? me? always! |
81 |
# RM note: suspicious? me? always! |
| 77 |
} elsif (exists $overrides{$module}) { |
82 |
} |
|
|
83 |
elsif ( exists $overrides{$module} ) { |
| 78 |
print "$overrides{$module}\n"; |
84 |
print "$overrides{$module}\n"; |
| 79 |
} else { |
85 |
} |
|
|
86 |
else { |
| 80 |
print "EEEK: unknown package for $module\n"; |
87 |
print "EEEK: unknown package for $module\n"; |
| 81 |
} |
88 |
} |
| 82 |
} |
89 |
} |
| 83 |
- |
|
|