-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
49879e8
commit a5f20ba
Showing
8 changed files
with
23 additions
and
92 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ use constant DEBUG => $ENV{PURL_DEBUG}; | |
|
||
use overload '""' => 'to_string', fallback => 1; | ||
|
||
our $VERSION = '2.22'; | ||
our $VERSION = '2.22_1'; | ||
our @EXPORT = qw(encode_purl decode_purl); | ||
|
||
my $PURL_REGEXP = qr{^pkg:[A-Za-z\\.\\-\\+][A-Za-z0-9\\.\\-\\+]*/.+}; | ||
|
@@ -296,8 +296,8 @@ URI::PackageURL - Perl extension for Package URL (aka "purl") | |
$purl = decode_purl('pkg:cpan/GDT/[email protected]'); | ||
say $purl->type; # cpan | ||
$purl_string = encode_purl(type => cpan, name => 'URI::PackageURL', version => '2.22'); | ||
say $purl_string; # pkg:cpan/URI::[email protected] | ||
$purl_string = encode_purl(type => cpan, namespace => 'GDT', name => 'URI-PackageURL', version => '2.22'); | ||
say $purl_string; # pkg:cpan/GDT/URI-[email protected] | ||
=head1 DESCRIPTION | ||
|
@@ -349,23 +349,11 @@ C<cpan> is an official "purl" type (L<https://github.com/package-url/purl-spec/b | |
=item * The default repository is C<https://www.cpan.org/>. | ||
=item * The C<namespace>: | ||
=item * The C<namespace> is the CPAN id of the author/publisher. It MUST be written uppercase and is required. | ||
=over | ||
=item * To refer to a CPAN distribution name, the C<namespace> MUST be present. | ||
In this case, the namespace is the CPAN id of the author/publisher. | ||
It MUST be written uppercase, followed by the distribution name in the name component. | ||
A distribution name MUST NOT contain the string C<::>. | ||
=item * To refer to a CPAN module, the C<namespace> MUST be absent. | ||
The module name MAY contain zero or more C<::> strings, and the module name MUST NOT contain a C<-> | ||
=back | ||
=item * The C<name> is the module or distribution name and is case sensitive. | ||
=item * The C<name> is the distribution name and is case sensitive. | ||
=item * The C<version> is the module or distribution version. | ||
=item * The C<version> is the distribution version. | ||
=item * Optional qualifiers may include: | ||
|
@@ -385,13 +373,9 @@ The module name MAY contain zero or more C<::> strings, and the module name MUST | |
=head3 Examples | ||
pkg:cpan/Perl::[email protected] | ||
pkg:cpan/DROLSKY/[email protected] | ||
pkg:cpan/[email protected] | ||
pkg:cpan/GDT/URI-PackageURL | ||
pkg:cpan/LWP::UserAgent | ||
pkg:cpan/OALDERS/[email protected] | ||
pkg:cpan/URI | ||
=head2 FUNCTIONAL INTERFACE | ||
|
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
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
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 |
---|---|---|
|
@@ -9,25 +9,21 @@ use URI::PackageURL qw(encode_purl); | |
|
||
|
||
my @TESTS = ( | ||
{purl => 'pkg:cpan/Perl::[email protected]', type => 'cpan', name => 'Perl::Version', version => '1.013'}, | ||
{ | ||
purl => 'pkg:cpan/DROLSKY/[email protected]', | ||
type => 'cpan', | ||
namespace => 'DROLSKY', | ||
name => 'DateTime', | ||
version => '1.55' | ||
}, | ||
{purl => 'pkg:cpan/[email protected]', type => 'cpan', name => 'DateTime', version => '1.55'}, | ||
{purl => 'pkg:cpan/GDT/URI-PackageURL', type => 'cpan', namespace => 'GDT', name => 'URI-PackageURL',}, | ||
{purl => 'pkg:cpan/LWP::UserAgent', type => 'cpan', name => 'LWP::UserAgent'}, | ||
{purl => 'pkg:cpan/GDT/URI-PackageURL', type => 'cpan', namespace => 'GDT', name => 'URI-PackageURL',}, | ||
{ | ||
purl => 'pkg:cpan/OALDERS/[email protected]', | ||
type => 'cpan', | ||
namespace => 'OALDERS', | ||
name => 'libwww-perl', | ||
version => '6.76' | ||
}, | ||
{purl => 'pkg:cpan/URI', type => 'cpan', name => 'URI'}, | ||
{ | ||
purl => 'pkg:generic/100%25/100%25@100%25?repository_url=https://example.com/100%2525/#100%25', | ||
type => 'generic', | ||
|
@@ -38,13 +34,6 @@ my @TESTS = ( | |
subpath => '100%', | ||
}, | ||
{purl => 'pkg:brew/openssl%[email protected]', type => 'brew', name => '[email protected]', version => '1.1.1w'}, | ||
{purl => 'pkg:cpan/[email protected]%402', type => 'cpan', name => 'Storable', version => '0.6@2'}, | ||
{ | ||
purl => 'pkg:cpan/[email protected]%403-bin-1-MacOS', | ||
type => 'cpan', | ||
name => 'Storable', | ||
version => '0.5@3-bin-1-MacOS' | ||
}, | ||
); | ||
|
||
|
||
|
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 |
---|---|---|
|
@@ -553,30 +553,18 @@ | |
}, | ||
{ | ||
"description": "cpan distribution name are case sensitive", | ||
"purl": "pkg:cpan/DROLSKY/[email protected]", | ||
"canonical_purl": "pkg:cpan/DROLSKY/[email protected]", | ||
"purl": "pkg:cpan/GDT/[email protected]", | ||
"canonical_purl": "pkg:cpan/GDT/[email protected]", | ||
"type": "cpan", | ||
"namespace": "DROLSKY", | ||
"name": "DateTime", | ||
"version": "1.55", | ||
"qualifiers": null, | ||
"subpath": null, | ||
"is_invalid": false | ||
}, | ||
{ | ||
"description": "cpan module name are case sensitive", | ||
"purl": "pkg:cpan/URI::[email protected]", | ||
"canonical_purl": "pkg:cpan/URI::[email protected]", | ||
"type": "cpan", | ||
"namespace": null, | ||
"name": "URI::PackageURL", | ||
"version": "2.11", | ||
"namespace": "GDT", | ||
"name": "URI-PackageURL", | ||
"version": "2.23", | ||
"qualifiers": null, | ||
"subpath": null, | ||
"is_invalid": false | ||
}, | ||
{ | ||
"description": "cpan module name like distribution name", | ||
"description": "cpan distribution without author", | ||
"purl": "pkg:cpan/[email protected]", | ||
"canonical_purl": "pkg:cpan/[email protected]", | ||
"type": "cpan", | ||
|
@@ -598,29 +586,5 @@ | |
"qualifiers": null, | ||
"subpath": null, | ||
"is_invalid": true | ||
}, | ||
{ | ||
"description": "cpan valid module name", | ||
"purl": "pkg:cpan/[email protected]", | ||
"canonical_purl": "pkg:cpan/[email protected]", | ||
"type": "cpan", | ||
"namespace": null, | ||
"name": "DateTime", | ||
"version": "1.55", | ||
"qualifiers": null, | ||
"subpath": null, | ||
"is_invalid": false | ||
}, | ||
{ | ||
"description": "cpan valid module name without version", | ||
"purl": "pkg:cpan/URI", | ||
"canonical_purl": "pkg:cpan/URI", | ||
"type": "cpan", | ||
"namespace": null, | ||
"name": "URI", | ||
"version": null, | ||
"qualifiers": null, | ||
"subpath": null, | ||
"is_invalid": false | ||
} | ||
] |