my %args = @_;
- my ($category, $name, $version);
+ my ($range, $category, $name, $version);
if (defined $args{name}) {
- ($category, $name, $version) = @args{qw/category name version/};
+ ($range, $category, $name, $version) = @args{qw/range category name version/};
Carp::confess('Category unspecified') unless defined $category;
/[^\w-]/ and Carp::confess('Invalid argument') for $name, $category;
} elsif (defined $args{atom}) {
my $atom = $args{atom};
- $atom =~ m{^([\w-]+)/([\w-]+)-v?($version_rx)$}
+ $atom =~ m{^(<|<=|=|>=|>)?([\w-]+)/([\w-]+)(?-v?($version_rx))?$}
or Carp::confess('Invalid atom');
- ($category, $name, $version) = ($1, $2, $3);
+ ($range, $category, $name, $version) = ($1, $2, $3, $4);
} else {
Carp::confess('Not enough information for building an atom object');
}
}
}
- my $range = $args{range};
if (defined $version) {
if (defined $range) {
Carp::confess("Invalid range $range")