View | Details | Raw Unified | Return to bug 25889
Collapse All | Expand All

(-)a/debian/list-deps (-13 / +13 lines)
Lines 18-23 Link Here
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
use Modern::Perl;
20
use Modern::Perl;
21
use Parallel::ForkManager;
22
use Sys::CPU;
21
23
22
use C4::Installer::PerlModules;
24
use C4::Installer::PerlModules;
23
25
Lines 42-56 my %ignore = ( Link Here
42
44
43
my $prefix = "^/usr/((lib|share)/perl5|(lib|share)/perl/[0-9.]+|(lib|share)/.*-linux-gnu.*/perl/[0-9.]+|(lib|share)/.*-linux-gnu.*/perl5/[0-9.]+)";
45
my $prefix = "^/usr/((lib|share)/perl5|(lib|share)/perl/[0-9.]+|(lib|share)/.*-linux-gnu.*/perl/[0-9.]+|(lib|share)/.*-linux-gnu.*/perl5/[0-9.]+)";
44
46
47
my $pm   = new Parallel::ForkManager( Sys::CPU::cpu_count() );
48
45
my $modules = C4::Installer::PerlModules->new();
49
my $modules = C4::Installer::PerlModules->new();
46
my $prereqs = $modules->prereqs;
50
my $prereqs = $modules->prereqs;
47
foreach my $phase ($prereqs->phases) {
51
foreach my $phase ($prereqs->phases) {
48
    foreach my $type ($prereqs->types_in($phase)) {
52
    foreach my $type ($prereqs->types_in($phase)) {
49
        my $reqs = $prereqs->requirements_for($phase, $type);
53
        my $reqs = $prereqs->requirements_for($phase, $type);
54
55
        MODULE_LOOP:
50
        foreach my $module ( $reqs->required_modules ) {
56
        foreach my $module ( $reqs->required_modules ) {
57
            my $pid = $pm->start and next MODULE_LOOP;
58
51
            next if $ignore{$module};
59
            next if $ignore{$module};
52
            my $subpath = $module;
60
            my $subpath = $module;
53
            $subpath =~ s,::,/,g;
61
            $subpath =~ s,::,/,g;
62
54
            my $output = qx(apt-file -l -x search "$prefix/$subpath.pm\$");
63
            my $output = qx(apt-file -l -x search "$prefix/$subpath.pm\$");
55
            my @temp   = split( /\n/, $output );
64
            my @temp   = split( /\n/, $output );
56
            my @lines  = ();
65
            my @lines  = ();
Lines 83-100 foreach my $phase ($prereqs->phases) { Link Here
83
                print "\n";
92
                print "\n";
84
            }
93
            }
85
            elsif ( scalar(@temp) != 0 ) {
94
            elsif ( scalar(@temp) != 0 ) {
86
95
                # hmm, skip module
87
                # I'm an Essential and I'm OK,
88
                # I install all night, and work all day.
89
                # I chomp up strings. I eat my bugs.
90
                # I go to the base install.
91
                # On Fridays I go drinking,
92
                # and have buttered commits for git.
93
                # (Beer O'Clock is more than two hours
94
                # away. I don't even drink beer. There
95
                # is no reason to be suspicious of this
96
                # commit.)
97
                # RM note: suspicious?  me?  always!
98
            }
96
            }
99
            elsif ( $type ne 'requires' ) {
97
            elsif ( $type ne 'requires' ) {
100
                # Ignore because we don't have it and we don't care.
98
                # Ignore because we don't have it and we don't care.
Lines 102-107 foreach my $phase ($prereqs->phases) { Link Here
102
            else {
100
            else {
103
                print "EEEK: unknown package for $module\n";
101
                print "EEEK: unknown package for $module\n";
104
            }
102
            }
103
104
            $pm->finish; # Terminates the child process
105
        }
105
        }
106
    }
106
    }
107
}
107
}
108
- 
108
$pm->wait_all_children;

Return to bug 25889