Skip to content

Commit

Permalink
Add a (hoepfully temporary) hack for Module::Build
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Dec 17, 2014
1 parent daec426 commit 7ffb544
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/Inline/Module.pm
Expand Up @@ -157,6 +157,9 @@ sub included_modules {
'Inline::Module',
@$ilsm,
);
if (caller eq 'Module::Build::InlineModule') {
push @include, 'Module::Build::InlineModule';
}
if (grep /:C$/, @$ilsm) {
push @include,
'Inline::C::Parser::RegExp';
Expand Down Expand Up @@ -390,12 +393,25 @@ sub write_module {
sub add_to_manifest {
my ($class, $distdir, @files) = @_;
my $manifest = "$distdir/MANIFEST";

# XXX Module::Build thing.
# XXX Call Module::Build->_add_to_manifest
my $chmod = 0;
if (not -w $manifest) {
chmod 0644, $manifest;
$chmod = 1;
}

open my $out, '>>', $manifest
or die "Can't open '$manifest' for append:\n$!";
for my $file (@files) {
print $out "$file\n";
}
close $out;

if ($chmod) {
chmod 0444, $manifest;
}
}

1;

0 comments on commit 7ffb544

Please sign in to comment.