aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2019-04-27 14:44:12 +0200
committerPatrick Spek <p.spek@tyil.nl>2019-04-27 14:44:12 +0200
commit306177e2f122d2ad98acbad3a91ab6dabbbd1087 (patch)
tree9d4bb5aaf71a3322d1c864c8e4327652614e583c
parentca00c139ec8025d8d9277e8c854c16457f2bfc0c (diff)
downloadApp::CPAN-306177e2f122d2ad98acbad3a91ab6dabbbd1087.tar.gz
App::CPAN-306177e2f122d2ad98acbad3a91ab6dabbbd1087.tar.bz2
Add PAUSE IDs for modules imported using --cpan
-rw-r--r--lib/App/CPAN/Bin/Import.pm68
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/App/CPAN/Bin/Import.pm6 b/lib/App/CPAN/Bin/Import.pm6
index bcfba8c..4d09051 100644
--- a/lib/App/CPAN/Bin/Import.pm6
+++ b/lib/App/CPAN/Bin/Import.pm6
@@ -73,7 +73,13 @@ multi sub MAIN (
my $meta = META6.new(:file(extract-meta-from-dist($dist)));
- if import-by-meta6($meta) -> $uuid {
+ # All Perl 6 modules appear in the Perl 6 directory, which is a direct
+ # child of the directory named after the PAUSE ID. Additionally, it
+ # seems that subdirectories are not properly scanned, so the second
+ # parent of every dist is always the directory named after a PAUSE ID.
+ my $pause-id = $dist.parent(2).basename;
+
+ if import-by-meta6($meta, $pause-id) -> $uuid {
say "$meta.&colorize-str() added as {colored(~$uuid, "bold")}.";
}
}