diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2010-11-14 07:24:07 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2010-11-14 07:24:07 +0000 |
commit | 34a241eee42ffb2c474c864dbf216ea5aad12cba (patch) | |
tree | ec8b8ba7d20f8c8a434871329439b2da5d5f5b7a | |
parent | 85c3dc83a3e686c92a6ef978c242e1f5e6301540 (diff) |
simplify slightly, make the . optional
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/LibSpec/Build.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/LibSpec/Build.pm b/usr.sbin/pkg_add/OpenBSD/LibSpec/Build.pm index d0d1d6881ae..06859003a20 100644 --- a/usr.sbin/pkg_add/OpenBSD/LibSpec/Build.pm +++ b/usr.sbin/pkg_add/OpenBSD/LibSpec/Build.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Build.pm,v 1.5 2010/06/30 10:51:04 espie Exp $ +# $OpenBSD: Build.pm,v 1.6 2010/11/14 07:24:06 espie Exp $ # # Copyright (c) 2010 Marc Espie <espie@openbsd.org> # @@ -102,7 +102,7 @@ sub no_match_major sub to_string { my $self = shift; - return join('.', $self->key, ">=".$self->major, $self->minor); + return $self->key.">=".$self->major.".".$self->minor; } @@ -115,9 +115,9 @@ sub new_from_string my ($class, $string) = @_; $string =~ s/\.$//; - if (my ($stem, $strict, $major, $minor) = $string =~ m/^(.*)\.(\>?)\=(\d+)\.(\d+)$/o) { + if (my ($stem, $strict, $major, $minor) = $string =~ m/^(.*?)\.?(\>?)\=(\d+)\.(\d+)$/o) { return $class->new_object($stem, $strict, $major, $minor); - } elsif (($stem, $strict, $major) = $string =~ m/^(.*)\.(\>?)\=(\d+)$/o) { + } elsif (($stem, $strict, $major) = $string =~ m/^(.*?)\.?(\>?)\=(\d+)$/o) { return $class->new_object($stem, $strict, $major, 0); } else { return $class->new_object($string, '>', 0, 0); |