3 # Write dependency list from Koha PerlDependencies.pm, in Debian format.
5 # Copyright 2010 Catalyst IT, Ltd
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
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
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/>.
24 use C4::Installer::PerlDependencies;
26 my $deps = $C4::Installer::PerlDependencies::PERL_DEPS;
28 my $prefix = "^/usr/((lib|share)/perl5|(lib|share)/perl/[0-9.]+)";
30 foreach my $module (keys %$deps) {
31 my $ver = $deps->{$module}->{'min_ver'};
32 my $subpath = $module;
35 qx(apt-file -l -x search "$prefix/$subpath.pm\$");
36 my @lines = split(/\n/, $output);
37 if (scalar(@lines) == 1 && $lines[0] ne "") {
40 } elsif (scalar(@lines) > 1) {
41 foreach my $pkg (@lines) {
42 print " | " if ($pkg ne $lines[0]);
47 print "EEEK: unknown package for $module\n";