Skip to content

Commit

Permalink
Add Swid support
Browse files Browse the repository at this point in the history
  • Loading branch information
giterlizzi committed Jun 1, 2024
1 parent 9bdf709 commit a9ba764
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/URI/PackageURL/App.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use Data::Dumper ();

use URI::PackageURL ();

our $VERSION = '2.20';
our $VERSION = '2.20_2';

sub cli_error {
my ($error) = @_;
Expand Down
12 changes: 12 additions & 0 deletions lib/URI/PackageURL/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ sub purl_components_normalize {
huggingface => \&_huggingface_normalize,
mlflow => \&_mlflow_normalize,
pypi => \&_pypi_normalize,
swid => \&_swid_normalize,
swift => \&_swift_normalize,
);

Expand Down Expand Up @@ -153,6 +154,17 @@ sub _pypi_normalize {

}

sub _swid_normalize {

my (%component) = @_;

Carp::croak "Invalid Package URL: swid 'tag_id' qualifier is required"
unless defined $component{qualifiers}->{tag_id};

return \%component;

}

sub _swift_normalize {

my (%component) = @_;
Expand Down
2 changes: 1 addition & 1 deletion lib/URI/VersionRange.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use constant FALSE => !!0;

use overload '""' => 'to_string', fallback => 1;

our $VERSION = '2.20';
our $VERSION = '2.20_2';
our @EXPORT = qw(encode_vers decode_vers);

my $VERS_REGEXP = qr{^vers:[a-z\\.\\-\\+][a-z0-9\\.\\-\\+]*/.+};
Expand Down
2 changes: 1 addition & 1 deletion lib/URI/VersionRange/App.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use Data::Dumper ();

use URI::VersionRange ();

our $VERSION = '2.20';
our $VERSION = '2.20_2';

sub cli_error {
my ($error) = @_;
Expand Down
2 changes: 1 addition & 1 deletion lib/URI/VersionRange/Constraint.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use overload '""' => 'to_string', fallback => 1;

use URI::VersionRange::Version;

our $VERSION = '2.20';
our $VERSION = '2.20_2';

our %COMPARATOR = (
'=' => 'equal',
Expand Down

0 comments on commit a9ba764

Please sign in to comment.