Re: [Module-build-general] read_config()?
Status: Beta
Brought to you by:
kwilliams
|
From: Scott B. <lis...@ni...> - 2003-05-22 12:02:46
|
I had a bit of time so I went ahead and made the changes I
outlined. It all works, with one caveat.
find_dist_packages() is called by write_metadata().
Unfortunately, it is trying to find out information about
modules in the PL_files list that do not yet exist. It was
easy to work around, but it means the META.yml file will
be incomplete when passed to the PL file.
When META.yml is rebuild by dist_dir it will be complete,
so this is not a regression. However, the inconsistent
behavior may surprise people.
Scott
--- Module/Build/Base.pm.orig Sat Apr 5 22:45:14 2003
+++ Module/Build/Base.pm Thu May 22 06:58:36 2003
@@ -704,9 +704,12 @@
if ($self->{properties}{autosplit}) {
$self->autosplit_file($self->{properties}{autosplit}, $blib);
}
-
- $self->process_PL_files;
-
+
+ my $metafile = 'META.yml';
+ $self->write_metadata($metafile);
+
+ $self->process_PL_files($metafile);
+
$self->compile_support_files;
$self->process_pm_files;
@@ -895,7 +898,7 @@
}
sub process_PL_files {
- my ($self) = @_;
+ my ($self, $postargs) = @_;
my $files = $self->find_PL_files;
while (my ($file, $to) = each %$files) {
@@ -905,7 +908,7 @@
# XXX - needs to use File::Spec
if (grep {!-e $_ or -M _ > -M $file} @to) {
- $self->run_perl_script($file);
+ $self->run_perl_script($file, [], [$postargs]);
$self->add_to_cleanup(@to);
}
}
@@ -1080,6 +1083,7 @@
$node->{version} = $p->{dist_version};
$node->{license} = $p->{license};
$node->{distribution_type} = 'module';
+ $node->{module_data} = $p->{module_data};
foreach (qw(requires recommends build_requires conflicts dynamic_config)) {
$node->{$_} = $p->{$_} if exists $p->{$_};
@@ -1114,6 +1118,7 @@
my $localfile = File::Spec->catfile( split m{/}, $file );
my $module = Module::Info->new_from_file( $localfile );
+ next unless $module;
print "Scanning $localfile for packages\n";
my %packages = $module->package_versions;
while (my ($package, $version) = each %packages) {
|