31 |
my $i = [split /\s+/, shift, 3]; |
my $i = [split /\s+/, shift, 3]; |
32 |
$i->[3] = 'perl-pm'; |
$i->[3] = 'perl-pm'; |
33 |
push @{$Opt{create_module}}, $i; |
push @{$Opt{create_module}}, $i; |
34 |
push @target_modules, [$i->[0], $i->[2]]; |
push @target_modules, $i->[0]; |
35 |
}, |
}, |
36 |
'create-perl-test=s' => sub { |
'create-perl-test=s' => sub { |
37 |
shift; |
shift; |
38 |
my $i = [split /\s+/, shift, 3]; |
my $i = [split /\s+/, shift, 3]; |
39 |
$i->[3] = 'perl-t'; |
$i->[3] = 'perl-t'; |
40 |
push @{$Opt{create_module}}, $i; |
push @{$Opt{create_module}}, $i; |
41 |
push @target_modules, [$i->[0], $i->[2]]; |
push @target_modules, $i->[0]; |
42 |
}, |
}, |
43 |
'debug' => \$Opt{debug}, |
'debug' => \$Opt{debug}, |
44 |
'dis-file-suffix=s' => \$Opt{dis_suffix}, |
'dis-file-suffix=s' => \$Opt{dis_suffix}, |
50 |
'load-module=s' => sub { |
'load-module=s' => sub { |
51 |
shift; |
shift; |
52 |
my $i = [split /\s+/, shift, 2]; |
my $i = [split /\s+/, shift, 2]; |
53 |
push @target_modules, [$i->[0], $i->[1]]; |
push @target_modules, $i->[0]; |
54 |
}, |
}, |
55 |
'mod-file-suffix=s' => \$Opt{mod_suffix}, |
'mod-file-suffix=s' => \$Opt{mod_suffix}, |
56 |
'search-path|I=s' => sub { |
'search-path|I=s' => sub { |
128 |
print STDERR $s if $Opt{verbose}; |
print STDERR $s if $Opt{verbose}; |
129 |
} |
} |
130 |
|
|
131 |
|
sub daf_open_source_dis_document ($); |
132 |
|
sub daf_open_current_module_index ($$); |
133 |
|
sub daf_convert_dis_document_to_dnl_document (); |
134 |
|
sub daf_get_referring_module_uri_list ($); |
135 |
|
sub dac_search_file_path_stem ($$$); |
136 |
|
sub daf_get_module_index_file_name ($); |
137 |
|
sub daf_check_undefined (); |
138 |
|
|
139 |
## ---- The MAIN Program |
## ---- The MAIN Program |
140 |
|
|
141 |
my $start_time; |
my $start_time; |
157 |
} |
} |
158 |
} |
} |
159 |
|
|
160 |
our $impl = $Message::DOM::ImplementationRegistry->get_implementation; |
our $impl = $Message::DOM::ImplementationRegistry->get_dom_implementation; |
161 |
|
|
162 |
## --- Loading and Updating the Database |
## --- Loading and Updating the Database |
163 |
|
|
180 |
$db->pl_update_module (\@target_modules, |
$db->pl_update_module (\@target_modules, |
181 |
get_module_index_file_name => sub { |
get_module_index_file_name => sub { |
182 |
shift; # $db |
shift; # $db |
183 |
daf_get_module_index_file_name (@_); |
daf_get_module_index_file_name (shift); |
184 |
}, |
}, |
185 |
get_module_source_document_from_uri => sub { |
get_module_source_document_from_uri => sub { |
186 |
my ($db, $module_uri, $module_for) = @_; |
my ($db, $module_uri, $module_for) = @_; |
196 |
} |
} |
197 |
return $ModuleSourceDNLDocument{$module_uri}; |
return $ModuleSourceDNLDocument{$module_uri}; |
198 |
}, |
}, |
199 |
get_module_source_document_from_resource => sub ($$$$$$) { |
get_module_source_document_from_resource => sub ($$$$$) { |
200 |
my ($self, $db, $uri, $ns, $ln, $for) = @_; |
my ($self, $db, $uri, $ns, $ln) = @_; |
201 |
status_msg ''; |
status_msg ''; |
202 |
status_msg qq<Loading module "$ln" for <$for>...>; |
status_msg qq<Loading module "$ln"...>; |
203 |
$ResourceCount = 0; |
$ResourceCount = 0; |
204 |
|
|
205 |
my $module_uri = $ns.$ln; |
my $module_uri = $ns.$ln; |
299 |
## --- Creating Files |
## --- Creating Files |
300 |
|
|
301 |
for (@{$Opt{create_module}}) { |
for (@{$Opt{create_module}}) { |
302 |
my ($mod_uri, $out_file_path, $mod_for, $out_type) = @$_; |
my ($mod_uri, $out_file_path, undef, $out_type) = @$_; |
303 |
|
|
304 |
if ($out_type eq 'perl-pm') { |
if ($out_type eq 'perl-pm') { |
305 |
daf_perl_pm ($mod_uri, $out_file_path, $mod_for); |
daf_perl_pm ($mod_uri, $out_file_path); |
306 |
} elsif ($out_type eq 'perl-t') { |
} elsif ($out_type eq 'perl-t') { |
307 |
daf_perl_t ($mod_uri, $out_file_path, $mod_for); |
daf_perl_t ($mod_uri, $out_file_path); |
308 |
} elsif ($out_type eq 'dtd-modules') { |
} elsif ($out_type eq 'dtd-modules') { |
309 |
daf_dtd_modules ($mod_uri, $out_file_path, $mod_for); |
daf_dtd_modules ($mod_uri, $out_file_path); |
310 |
} elsif ($out_type eq 'dtd-driver') { |
} elsif ($out_type eq 'dtd-driver') { |
311 |
daf_dtd_driver ($mod_uri, $out_file_path, $mod_for); |
daf_dtd_driver ($mod_uri, $out_file_path); |
312 |
} |
} |
313 |
} |
} |
314 |
|
|
472 |
return undef; |
return undef; |
473 |
} # dac_search_file_path_stem; |
} # dac_search_file_path_stem; |
474 |
|
|
475 |
sub daf_get_module_index_file_name ($$) { |
sub daf_get_module_index_file_name ($) { |
476 |
my ($module_uri) = @_; |
my ($module_uri) = @_; |
477 |
my $ns = $module_uri; |
my $ns = $module_uri; |
478 |
$ns =~ s/(\w+)\z//; |
$ns =~ s/(\w+)\z//; |