From ca3b3d09cbac2533b06a1fa28e492164fed4f31c Mon Sep 17 00:00:00 2001 From: Giuseppe Di Terlizzi Date: Wed, 24 Jul 2024 23:53:05 +0200 Subject: [PATCH] URI::PackageURL 2.21 --- Changes | 7 +++++++ README.md | 20 ++++++++++---------- lib/URI/PackageURL.pm | 6 +++--- lib/URI/PackageURL/App.pm | 2 +- lib/URI/PackageURL/Util.pm | 2 +- lib/URI/VersionRange.pm | 2 +- lib/URI/VersionRange/App.pm | 2 +- lib/URI/VersionRange/Constraint.pm | 2 +- t/40-cli.t | 4 ++-- t/90-cpan-distname-info.t | 2 +- 10 files changed, 28 insertions(+), 21 deletions(-) diff --git a/Changes b/Changes index dbd782e..b193f03 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,12 @@ Change history for URI-PackageURL +2.21 2024-07-24 + - Use RFC 2119 terms for CPAN purl type specification (sjn) + - Added "swid" purl type support + - Moved normalization and validation check in "URI::PackageURL::Util" + - Dropped support for "version_prefix" qualifier for "github", "gitlab" and + "bitbucket" PURL types in "purl_to_urls" util (pombredanne via giterlizzi/perl-URI-PackageURL#14) + 2.20 2024-05-13 - Added support for the official "cpan" PURL type specification (giterlizzi/perl-URI-PackageURL#8) - Added "Version Range" (vers) support (giterlizzi/perl-URI-PackageURL#12) diff --git a/README.md b/README.md index cdccac1..6b7b27d 100644 --- a/README.md +++ b/README.md @@ -10,19 +10,19 @@ use URI::PackageURL; # OO-interface # Encode components in PackageURL string -$purl = URI::PackageURL->new(type => cpan, namespace => 'GDT', name => 'URI-PackageURL', version => '2.20'); +$purl = URI::PackageURL->new(type => cpan, namespace => 'GDT', name => 'URI-PackageURL', version => '2.21'); -say $purl; # pkg:cpan/GDT/URI-PackageURL@2.20 +say $purl; # pkg:cpan/GDT/URI-PackageURL@2.21 # Parse PackageURL string -$purl = URI::PackageURL->from_string('pkg:cpan/GDT/URI-PackageURL@2.20'); +$purl = URI::PackageURL->from_string('pkg:cpan/GDT/URI-PackageURL@2.21'); # exported functions -$purl = decode_purl('pkg:cpan/GDT/URI-PackageURL@2.20'); +$purl = decode_purl('pkg:cpan/GDT/URI-PackageURL@2.21'); say $purl->type; # cpan -$purl_string = encode_purl(type => cpan, namespace => 'GDT', name => 'URI::PackageURL', version => '2.20'); +$purl_string = encode_purl(type => cpan, namespace => 'GDT', name => 'URI::PackageURL', version => '2.21'); ``` @@ -31,14 +31,14 @@ $purl_string = encode_purl(type => cpan, namespace => 'GDT', name => 'URI::Packa Inspect and export "purl" string in various formats (JSON, YAML, Data::Dumper, ENV): ```console -$ purl-tool pkg:cpan/GDT/URI-PackageURL@2.20 --json | jq +$ purl-tool pkg:cpan/GDT/URI-PackageURL@2.21 --json | jq { "name": "URI-PackageURL", "namespace": "GDT", "qualifiers": {}, "subpath": null, "type": "cpan", - "version": "2.20" + "version": "2.21" } ``` @@ -46,7 +46,7 @@ $ purl-tool pkg:cpan/GDT/URI-PackageURL@2.20 --json | jq Download package using "purl" string: ```console -$ wget $(purl-tool pkg:cpan/GDT/URI-PackageURL@2.20 --download-url) +$ wget $(purl-tool pkg:cpan/GDT/URI-PackageURL@2.21 --download-url) ``` @@ -57,7 +57,7 @@ Use "purl" string in your shell-scripts: set -e -PURL="pkg:cpan/GDT/URI-PackageURL@2.20" +PURL="pkg:cpan/GDT/URI-PackageURL@2.21" eval $(purl-tool "$PURL" --env) @@ -79,7 +79,7 @@ Create on-the-fly a "purl" string: $ purl-tool --type cpan \ --namespace GDT \ --name URI-PackageURL \ - --version 2.20 + --version 2.21 ``` diff --git a/lib/URI/PackageURL.pm b/lib/URI/PackageURL.pm index 4f06157..316ecf0 100644 --- a/lib/URI/PackageURL.pm +++ b/lib/URI/PackageURL.pm @@ -13,7 +13,7 @@ use constant DEBUG => $ENV{PURL_DEBUG}; use overload '""' => 'to_string', fallback => 1; -our $VERSION = '2.20_3'; +our $VERSION = '2.21'; our @EXPORT = qw(encode_purl decode_purl); my $PURL_REGEXP = qr{^pkg:[A-Za-z\\.\\-\\+][A-Za-z0-9\\.\\-\\+]*/.+}; @@ -283,7 +283,7 @@ URI::PackageURL - Perl extension for Package URL (aka "purl") type => cpan, namespace => 'GDT', name => 'URI-PackageURL', - version => '2.20_3' + version => '2.21' ); say $purl; # pkg:cpan/GDT/URI-PackageURL@2.20 @@ -296,7 +296,7 @@ URI::PackageURL - Perl extension for Package URL (aka "purl") $purl = decode_purl('pkg:cpan/GDT/URI-PackageURL@2.20'); say $purl->type; # cpan - $purl_string = encode_purl(type => cpan, name => 'URI::PackageURL', version => '2.20_3'); + $purl_string = encode_purl(type => cpan, name => 'URI::PackageURL', version => '2.21'); say $purl_string; # pkg:cpan/URI::PackageURL@2.20 =head1 DESCRIPTION diff --git a/lib/URI/PackageURL/App.pm b/lib/URI/PackageURL/App.pm index 4378c64..ca2a7ba 100644 --- a/lib/URI/PackageURL/App.pm +++ b/lib/URI/PackageURL/App.pm @@ -13,7 +13,7 @@ use Data::Dumper (); use URI::PackageURL (); -our $VERSION = '2.20_3'; +our $VERSION = '2.21'; sub cli_error { my ($error) = @_; diff --git a/lib/URI/PackageURL/Util.pm b/lib/URI/PackageURL/Util.pm index 6140918..6114ea2 100644 --- a/lib/URI/PackageURL/Util.pm +++ b/lib/URI/PackageURL/Util.pm @@ -7,7 +7,7 @@ use warnings; use Exporter qw(import); -our $VERSION = '2.20_3'; +our $VERSION = '2.21'; our @EXPORT = qw(purl_to_urls purl_components_normalize); sub purl_components_normalize { diff --git a/lib/URI/VersionRange.pm b/lib/URI/VersionRange.pm index dcd74d7..e1ffc5d 100644 --- a/lib/URI/VersionRange.pm +++ b/lib/URI/VersionRange.pm @@ -18,7 +18,7 @@ use constant FALSE => !!0; use overload '""' => 'to_string', fallback => 1; -our $VERSION = '2.20_3'; +our $VERSION = '2.21'; our @EXPORT = qw(encode_vers decode_vers); my $VERS_REGEXP = qr{^vers:[a-z\\.\\-\\+][a-z0-9\\.\\-\\+]*/.+}; diff --git a/lib/URI/VersionRange/App.pm b/lib/URI/VersionRange/App.pm index f182c21..c28b3ca 100644 --- a/lib/URI/VersionRange/App.pm +++ b/lib/URI/VersionRange/App.pm @@ -13,7 +13,7 @@ use Data::Dumper (); use URI::VersionRange (); -our $VERSION = '2.20_3'; +our $VERSION = '2.21'; sub cli_error { my ($error) = @_; diff --git a/lib/URI/VersionRange/Constraint.pm b/lib/URI/VersionRange/Constraint.pm index 2364b77..c8cfc7c 100644 --- a/lib/URI/VersionRange/Constraint.pm +++ b/lib/URI/VersionRange/Constraint.pm @@ -12,7 +12,7 @@ use overload '""' => 'to_string', fallback => 1; use URI::VersionRange::Version; -our $VERSION = '2.20_3'; +our $VERSION = '2.21'; our %COMPARATOR = ( '=' => 'equal', diff --git a/t/40-cli.t b/t/40-cli.t index e9969e1..8846cb2 100644 --- a/t/40-cli.t +++ b/t/40-cli.t @@ -27,7 +27,7 @@ sub cmd { } -my $t1 = 'pkg:cpan/GDT/URI-PackageURL@2.20'; +my $t1 = 'pkg:cpan/GDT/URI-PackageURL@2.21'; my $t2 = 'vers:cpan/1.00|>=2.00|<5.00'; subtest "URI::PackageURL::App - '$t1' (JSON output)" => sub { @@ -41,7 +41,7 @@ subtest "URI::PackageURL::App - '$t1' (JSON output)" => sub { is($test_2->{type}, 'cpan', 'JSON output: Type'); is($test_2->{namespace}, 'GDT', 'JSON output: Namespace'); is($test_2->{name}, 'URI-PackageURL', 'JSON output: Name'); - is($test_2->{version}, '2.20', 'JSON output: Version'); + is($test_2->{version}, '2.21', 'JSON output: Version'); }; diff --git a/t/90-cpan-distname-info.t b/t/90-cpan-distname-info.t index e8b0243..1b8a04f 100644 --- a/t/90-cpan-distname-info.t +++ b/t/90-cpan-distname-info.t @@ -83,4 +83,4 @@ KMACLEOD/Frontier-RPC-0.07b4.tar.gz RTFIREFLY/Frontier-RPC-0.07b4p1.tar.gz AJPEACOCK/HTML-Table-2.08a.tar.gz DANPEDER/MIME-Base32-1.02a.tar.gz -CPAN/authors/id/G/GD/GDT/URI-PackageURL-2.20.tar.gz +CPAN/authors/id/G/GD/GDT/URI-PackageURL-2.21.tar.gz