3 #use warnings; # corelist and find throw tons of warnings
 
   6 use SL::InstallationCheck;
 
   8 my (%uselines, %modules, %supplied);
 
  11   return unless /(\.p[lm]|console)$/;
 
  13   # remember modules shipped with Lx-Office
 
  14   $supplied{modulize($File::Find::name)}++
 
  15     if $File::Find::dir =~ m#modules/#;
 
  17   open my $fh, '<', $_ or warn "can't open $_: $!";
 
  22     next if /Support::Files/; # our own test support module
 
  23     next if /use (warnings|strict|vars|lib|constant|utf8)/;
 
  25     my ($useline) = m/^use\s+(.*?)$/;
 
  27     next if  $useline =~ /^[\d.]+;/; # skip version requirements
 
  30     $uselines{$useline}++;
 
  34 for my $useline (keys %uselines) {
 
  35   $useline =~ s/#.*//; # kill comments
 
  37   # modules can be loaded implicit with use base qw(Module) or use parent
 
  38   # 'Module'. catch these:
 
  39   my ($module, $args) = $useline =~ /
 
  44     )?                 # optional parent block
 
  49   # some comments looks very much like use lines
 
  50   # try to get rid of them
 
  51   next if $useline =~ /^it like a normal Perl node/;   # YAML::Dump comment
 
  52   next if $useline =~ /^most and offer that in a small/; # YAML
 
  54   my $version = Module::CoreList->first_release($module);
 
  55   $modules{$module} = $supplied{$module}     ? 'included'
 
  56                     : $version               ? sprintf '%2.6f', $version
 
  57                     : is_documented($module) ? 'required'
 
  61 print sprintf "%8s : %s", $modules{$_}, $_
 
  63        $modules{$a} cmp $modules{$b}
 
  68   for (my ($name) = @_) {
 
  78   return grep { $_->{name} eq $module } @SL::InstallationCheck::required_modules;
 
  89  # perl scipts/find-use.pl
 
  91  missing : Template::Constants
 
  96 This util is useful for package builders to identify all the CPAN dependencies
 
  97 we've made. It requires Module::CoreList (which is core, but is not in most
 
  98 stable releases of perl) to determine if a module is distributed with perl or
 
  99 not.  The output reports which version of perl the module is in.  If it reports
 
 100 0.000000, then the module is not in core perl, and needs to be installed before
 
 101 Lx-Office will operate.
 
 105 http://www.ledgersmb.org/ - The LedgerSMB team
 
 106 Sven Schöling E<lt>s.schoeling@linet-services.deE<gt>
 
 110 Distributed under the terms of the GNU General Public License v2.