metacpan-api
metacpan-api copied to clipboard
Unauthorized module incorrectly marked
MGRIMES/Perl-Tidy-Sweetened-0.21 included a local lib so it displays a ton of unauthorized modules in the "Documentation" section.
Additionally it shows up before the real module in a search: https://metacpan.org/search?q=dist+checkconflicts
To take one example: Perms do not list this author:
*$ zcat ~/perl5/cpan/mini/modules/06perms.txt.gz | grep File::Which
File::Which,ADAMK,c
File::Which,PEREINAR,m
File::Which::Cached,LEOCHARRE,f
However the api says the file is "authorized":
*$ curl api.metacpan.org/file/_search?pretty=1 -d '{"filter": {"and": [ {"term": {"author": "MGRIMES"}}, {"term": {"release": "Perl-Tidy-Sweetened-0.21"}}, {"term": {"name":"Which.pm"}} ] }}'
{
"timed_out" : false,
"hits" : {
"hits" : [
{
"_source" : {
"pod" : "NAME File::Which - Portable implementation of the `which' utility SYNOPSIS use File::Which; # exports which() use File::Which qw(which where); # exports which() and where() my $exe_path = which('perldoc'); my @paths = where('perl'); - Or - my @paths = which('perl'); # an array forces search for all of them DESCRIPTION \"File::Which\" was created to be able to get the paths to executable programs on systems under which the `which' program wasn't implemented in the shell. \"File::Which\" searches the directories of the user's \"PATH\" (as returned by \"File::Spec->path()\"), looking for executable files having the name specified as a parameter to \"which()\". Under Win32 systems, which do not have a notion of directly executable files, but uses special extensions such as \".exe\" and \".bat\" to identify them, \"File::Which\" takes extra steps to assure that you will find the correct file (so for example, you might be searching for \"perl\", it'll try perl.exe, perl.bat, etc.) Steps Used on Win32, DOS, OS2 and VMS Windows NT Windows NT has a special environment variable called \"PATHEXT\", which is used by the shell to look for executable files. Usually, it will contain a list in the form \".EXE;.BAT;.COM;.JS;.VBS\" etc. If \"File::Which\" finds such an environment variable, it parses the list and uses it as the different extensions. Windows 9x and other ancient Win/DOS/OS2 This set of operating systems don't have the \"PATHEXT\" variable, and usually you will find executable files there with the extensions \".exe\", \".bat\" and (less likely) \".com\". \"File::Which\" uses this hardcoded list if it's running under Win32 but does not find a \"PATHEXT\" variable. VMS Same case as Windows 9x: uses \".exe\" and \".com\" (in that order). Functions which($short_exe_name) Exported by default. $short_exe_name is the name used in the shell to call the program (for example, \"perl\"). If it finds an executable with the name you specified, \"which()\" will return the absolute path leading to this executable (for example, /usr/bin/perl or C:\\Perl\\Bin\\perl.exe). If it does *not* find the executable, it returns \"undef\". If \"which()\" is called in list context, it will return *all* the matches. where($short_exe_name) Not exported by default. Same as \"which($short_exe_name)\" in array context. Same as the `where' utility, will return an array containing all the path names matching $short_exe_name. BUGS AND CAVEATS Not tested on VMS or MacOS, although there is platform specific code for those. Anyone who haves a second would be very kind to send me a report of how it went. File::Spec adds the current directory to the front of PATH if on Win32, VMS or MacOS. I have no knowledge of those so don't know if the current directory is searced first or not. Could someone please tell me? SUPPORT Bugs should be reported via the CPAN bug tracker at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Which> For other issues, contact the maintainer. AUTHOR Adam Kennedy <[email protected]> Per Einar Ellefsen <[email protected]> Originated in modperl-2.0/lib/Apache/Build.pm. Changed for use in DocSet (for the mod_perl site) and Win32-awareness by me, with slight modifications by Stas Bekman, then extracted to create \"File::Which\". Version 0.04 had some significant platform-related changes, taken from the Perl Power Tools `which' implementation by Abigail with enhancements from Peter Prymmer. See <http://www.perl.com/language/ppt/src/which/index.html> for more information. COPYRIGHT Copyright 2002 Per Einar Ellefsen. Some parts copyright 2009 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO File::Spec, which(1), Perl Power Tools: <http://www.perl.com/language/ppt/index.html>. ",
"date" : "2013-10-02T16:49:45",
"status" : "latest",
"author" : "MGRIMES",
"directory" : false,
"maturity" : "released",
"indexed" : true,
"documentation" : "File::Which",
"id" : "gV4RA7xHby4GQJDPGZ6dEkmUytE",
"authorized" : true,
"pod_lines" : [
[
127,
127
]
],
"version" : "0.21",
"binary" : false,
"name" : "Which.pm",
"path" : ".local-v5.14/lib/perl5/File/Which.pm",
"release" : "Perl-Tidy-Sweetened-0.21",
"version_numified" : 0.21,
"description" : "\"File::Which\" was created to be able to get the paths to executable programs on systems under which the `which' program wasn't implemented in the shell. \"File::Which\" searches the directories of the user's \"PATH\" (as returned by \"File::Spec->path()\"), looking for executable files having the name specified as a parameter to \"which()\". Under Win32 systems, which do not have a notion of directly executable files, but uses special extensions such as \".exe\" and \".bat\" to identify them, \"File::Which\" takes extra steps to assure that you will find the correct file (so for example, you might be searching for \"perl\", it'll try perl.exe, perl.bat, etc.)",
"distribution" : "Perl-Tidy-Sweetened",
"stat" : {
"uid" : 1008,
"mtime" : 1380732534,
"mode" : 33060,
"size" : 6682,
"gid" : 100
},
"level" : 4,
"sloc" : 89,
"abstract" : "Portable implementation of the `which' utility",
"slop" : 82,
"mime" : "text/x-script.perl-module"
},
"_score" : 1,
"_index" : "cpan_v1",
"_id" : "gV4RA7xHby4GQJDPGZ6dEkmUytE",
"_type" : "file"
}
],
"max_score" : 1,
"total" : 1
},
"_shards" : {
"failed" : 0,
"successful" : 5,
"total" : 5
},
"took" : 112
}
Why is there no "module" info for that file? One of the intended modules in the release does have extra the module structure:
*$ curl api.metacpan.org/module/_search?pretty=1 -d '{"filter": {"and": [ {"term": {"author": "MGRIMES"}}, {"term": {"release": "Perl-Tidy-Sweetened-0.21"}}, {"term": {"name":"Sweetened.pm"}} ] }}'
{
"timed_out" : false,
"hits" : {
"hits" : [
{
"_source" : {
"pod" : "NAME Perl::Tidy::Sweetened - Tweaks to Perl::Tidy to support some syntactic sugar VERSION version 0.21 DESCRIPTION There are a number of modules on CPAN that allow users to write their classes with a more \"modern\" syntax. These tools eliminate the need to shift off $self, can support type checking and offer other improvements. Unfortunately, they can break the support tools that the Perl community has come to rely on. This module attempts to work around those issues. The module uses Perl::Tidy's \"prefilter\" and \"postfilter\" hooks to support \"method\" and \"func\" keywords, including the (possibly multi-line) parameter lists. This is quite an ugly hack, but it is the recommended method of supporting these new keywords (see the 2010-12-17 entry in the Perl::Tidy CHANGES <https://metacpan.org/source/SHANCOCK/Perl-Tidy-20120714/CHANGES> file). The resulting formatted code will leave the parameter lists untouched. \"Perl::Tidy::Sweetened\" attempts to support the syntax outlined in the following modules, but most of the new syntax styles should work: * p5-mop * Method::Signature::Simple * MooseX::Method::Signatures * MooseX::Declare SEE ALSO Perl::Tidy THANKS The idea and much of original code taken from Jonathan Swartz' blog <http://www.openswartz.com/2010/12/19/perltidy-and-method-happy-together/> . Kent Fredric refactored the code into the pluggable architecture. Very nice work, thank you. BUGS Please report any bugs or suggestions at <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl-Tidy-Sweetened> AUTHOR Mark Grimes, <[email protected]> COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Mark Grimes, <[email protected]>. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. ",
"date" : "2013-10-02T16:49:45",
"status" : "latest",
"author" : "MGRIMES",
"directory" : false,
"maturity" : "released",
"indexed" : true,
"documentation" : "Perl::Tidy::Sweetened",
"id" : "_1BZKd1ePYYfgHXVTMwviN6bMlo",
"module" : [
{
"indexed" : true,
"authorized" : true,
"associated_pod" : "MGRIMES/Perl-Tidy-Sweetened-0.21/lib/Perl/Tidy/Sweetened.pm",
"version" : "0.21",
"name" : "Perl::Tidy::Sweetened",
"version_numified" : 0.21
}
],
"authorized" : true,
"pod_lines" : [
[
71,
70
]
],
"version" : "0.21",
"binary" : false,
"name" : "Sweetened.pm",
"version_numified" : 0.21,
"release" : "Perl-Tidy-Sweetened-0.21",
"path" : "lib/Perl/Tidy/Sweetened.pm",
"description" : "There are a number of modules on CPAN that allow users to write their classes with a more \"modern\" syntax. These tools eliminate the need to shift off $self, can support type checking and offer other improvements. Unfortunately, they can break the support tools that the Perl community has come to rely on. This module attempts to work around those issues. The module uses Perl::Tidy's \"prefilter\" and \"postfilter\" hooks to support \"method\" and \"func\" keywords, including the (possibly multi-line) parameter lists. This is quite an ugly hack, but it is the recommended method of supporting these new keywords (see the 2010-12-17 entry in the Perl::Tidy CHANGES <https://metacpan.org/source/SHANCOCK/Perl-Tidy-20120714/CHANGES> file). The resulting formatted code will leave the parameter lists untouched. \"Perl::Tidy::Sweetened\" attempts to support the syntax outlined in the following modules, but most of the new syntax styles should work: * p5-mop * Method::Signature::Simple * MooseX::Method::Signatures * MooseX::Declare",
"distribution" : "Perl-Tidy-Sweetened",
"stat" : {
"uid" : 1008,
"mtime" : 1380732534,
"mode" : 33060,
"size" : 3846,
"gid" : 100
},
"level" : 3,
"sloc" : 44,
"abstract" : "Tweaks to Perl::Tidy to support some syntactic sugar",
"slop" : 43,
"mime" : "text/x-script.perl-module"
},
"_score" : 1,
"_index" : "cpan_v1",
"_id" : "_1BZKd1ePYYfgHXVTMwviN6bMlo",
"_type" : "file"
}
],
"max_score" : 1,
"total" : 1
},
"_shards" : {
"failed" : 0,
"successful" : 5,
"total" : 5
},
"took" : 223
}
It may also be worth noting that the "provides" section in the release appears to be correct(ly limited):
{
"resources" : {
"repository" : {
"url" : "http://github.com/mvgrimes/perl-tidy-sweetened"
},
"bugtracker" : {
"web" : "http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl-Tidy-Sweetened"
},
"license" : [
"http://dev.perl.org/licenses/"
]
},
"status" : "latest",
"date" : "2013-10-02T16:49:45",
"author" : "MGRIMES",
"maturity" : "released",
"dependency" : [
{
"relationship" : "requires",
"phase" : "runtime",
"version" : "5.010",
"version_numified" : 5.01,
"module" : "perl"
},
{
"relationship" : "requires",
"phase" : "runtime",
"version" : "0",
"version_numified" : 0,
"module" : "Perl::Tidy"
},
{
"relationship" : "requires",
"phase" : "runtime",
"version" : "0",
"version_numified" : 0,
"module" : "Carp"
},
{
"relationship" : "requires",
"phase" : "configure",
"version" : "0.36",
"version_numified" : 0.36,
"module" : "Module::Build"
},
{
"relationship" : "requires",
"phase" : "build",
"version" : "0.87",
"version_numified" : 0.87,
"module" : "Test::More"
},
{
"relationship" : "requires",
"phase" : "build",
"version" : "0",
"version_numified" : 0,
"module" : "Test::Differences"
},
{
"relationship" : "requires",
"phase" : "build",
"version" : "0",
"version_numified" : 0,
"module" : "Test::Most"
}
],
"id" : "Y6JVm8OZzXoPFSOnV23uYdiQ7JI",
"metadata" : {
"no_index" : {
"directory" : [
"t",
"xt",
"inc",
"example",
"blib",
"examples",
"eg"
]
},
"resources" : {
"repository" : {
"url" : "http://github.com/mvgrimes/perl-tidy-sweetened"
},
"bugtracker" : {
"web" : "http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl-Tidy-Sweetened"
},
"license" : [
"http://dev.perl.org/licenses/"
]
},
"meta-spec" : {
"version" : "2",
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec"
},
"generated_by" : "Module::Build version 0.4007, CPAN::Meta::Converter version 2.120351, CPAN::Meta::Converter version 2.131560",
"version" : "0.21",
"name" : "Perl-Tidy-Sweetened",
"author" : [
"Mark Grimes, E<lt>[email protected]<gt>"
],
"dynamic_config" : 1,
"license" : [
"perl_5"
],
"prereqs" : {
"runtime" : {
"requires" : {
"perl" : "5.010",
"Perl::Tidy" : "0",
"Carp" : "0"
}
},
"configure" : {
"requires" : {
"Module::Build" : "0.36"
}
},
"build" : {
"requires" : {
"Test::More" : "0.87",
"Test::Differences" : "0",
"Test::Most" : "0"
}
}
},
"provides" : {
"Perl::Tidy::Sweetened::Variable::Twigils" : {
"version" : "0.21",
"file" : "lib/Perl/Tidy/Sweetened/Variable/Twigils.pm"
},
"Perl::Tidy::Sweet" : {
"version" : "0.21",
"file" : "lib/Perl/Tidy/Sweet.pm"
},
"Perl::Tidy::Sweetened" : {
"version" : "0.21",
"file" : "lib/Perl/Tidy/Sweetened.pm"
},
"Perl::Tidy::Sweetened::Keyword::Block" : {
"version" : "0.21",
"file" : "lib/Perl/Tidy/Sweetened/Keyword/Block.pm"
},
"Perl::Tidy::Sweetened::Pluggable" : {
"version" : "0.21",
"file" : "lib/Perl/Tidy/Sweetened/Pluggable.pm"
}
},
"abstract" : "Tweaks to Perl::Tidy to support some syntactic sugar",
"release_status" : "stable"
},
"authorized" : true,
"download_url" : "http://cpan.metacpan.org/authors/id/M/MG/MGRIMES/Perl-Tidy-Sweetened-0.21.tar.gz",
"first" : false,
"archive" : "Perl-Tidy-Sweetened-0.21.tar.gz",
"version" : "0.21",
"name" : "Perl-Tidy-Sweetened-0.21",
"version_numified" : 0.21,
"license" : [
"perl_5"
],
"distribution" : "Perl-Tidy-Sweetened",
"stat" : {
"uid" : 1008,
"mtime" : 1380732585,
"mode" : 33188,
"size" : 1886229,
"gid" : 1008
},
"provides" : [
"Perl::Tidy::Sweetened::Variable::Twigils",
"Perl::Tidy::Sweetened",
"Perl::Tidy::Sweet",
"Perl::Tidy::Sweetened::Pluggable",
"Perl::Tidy::Sweetened::Keyword::Block"
],
"abstract" : "Tweaks to Perl::Tidy to support some syntactic sugar"
}
What is this 'dependency' field in the metadata? that's not in the spec.
no, the "metadata" key comes from the META file (and is therefore similar to the spec). Anything outside of that is custom metacpan data/structure.
ah sorry, that's metacpan data... goes back to the saltmines.. ;)