| … | |
… | |
| 16 | |
16 | |
| 17 | use strict; |
17 | use strict; |
| 18 | use sigtrap; |
18 | use sigtrap; |
| 19 | use Carp; |
19 | use Carp; |
| 20 | use Safe; |
20 | use Safe; |
| 21 | use Apache; |
21 | #use Apache; |
| 22 | use WeBWorK::Utils; |
22 | use WeBWorK::Utils; |
| 23 | use WeBWorK::CourseEnvironment; |
23 | use WeBWorK::CourseEnvironment; |
| 24 | use WeBWorK::PG::Translator; |
24 | use WeBWorK::PG::Translator; |
| 25 | use WeBWorK::PG::IO; |
25 | use WeBWorK::PG::IO; |
| 26 | use Benchmark; |
26 | use Benchmark; |
| … | |
… | |
| 108 | $dirPath = $prob_libs{$rh->{library_name}} ; |
108 | $dirPath = $prob_libs{$rh->{library_name}} ; |
| 109 | } else { |
109 | } else { |
| 110 | $out->{error} = "Could not find library:".$rh->{library_name}.":"; |
110 | $out->{error} = "Could not find library:".$rh->{library_name}.":"; |
| 111 | return($out); |
111 | return($out); |
| 112 | } |
112 | } |
| 113 | #warn "library directory path is $dirPath"; |
113 | warn "library directory path is $dirPath"; |
| 114 | my @outListLib; |
114 | my @outListLib; |
| 115 | my $wanted = sub { |
115 | my $wanted = sub { |
| 116 | my $name = $File::Find::name; |
116 | my $name = $File::Find::name; |
| 117 | my @out=(); |
117 | my @out=(); |
| 118 | if ($name =~/\S/ ) { |
118 | if ($name =~/\S/ ) { |
| … | |
… | |
| 123 | }; |
123 | }; |
| 124 | |
124 | |
| 125 | my $command = $rh->{command}; |
125 | my $command = $rh->{command}; |
| 126 | $command = 'all' unless defined($command); |
126 | $command = 'all' unless defined($command); |
| 127 | $command eq 'all' && do { |
127 | $command eq 'all' && do { |
| 128 | find({wanted=>$wanted,follow=>1 }, $dirPath); |
128 | find({wanted=>$wanted,follow_fast=>1 }, $dirPath); |
| 129 | @outListLib = sort @outListLib; |
129 | @outListLib = sort @outListLib; |
| 130 | $out->{ra_out} = \@outListLib; |
130 | $out->{ra_out} = \@outListLib; |
| 131 | $out->{text} = join("\n", @outListLib); |
131 | $out->{text} = join("\n", @outListLib); |
| 132 | return($out); |
132 | return($out); |
| 133 | }; |
133 | }; |