-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env perl | ||
package # hide from PAUSE | ||
makecpanfile; | ||
|
||
# Make a cpanfile from the dependencies in Makefile.PL. | ||
# Modified from https://github.com/miyagawa/cpanfile/blob/master/README.md | ||
# by miyagawa. Assumes MYMETA.json has already been created. | ||
use strict; | ||
use warnings; | ||
|
||
use CPAN::Meta; | ||
use File::Slurp qw(write_file); | ||
use Module::CPANfile; | ||
|
||
my $meta = CPAN::Meta->load_file("MYMETA.json"); | ||
my $file = Module::CPANfile->from_prereqs($meta->prereqs); | ||
my $contents = <<EOT . $file->to_string; | ||
# Auto-generated from Makefile.PL by cpanfile-from-Makefile-PL | ||
EOT | ||
# Note: No timestamp so that the header line doesn't show up in the git diff | ||
write_file('cpanfile', $contents); |