summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-07-11 10:05:19 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-07-11 10:05:19 +0000
commit3c83b0b46948c0f97e8f96976a752f37d16f1fe9 (patch)
tree8088a308dc00b5d6362894fab5bf2fd0a917a780 /usr.sbin/pkg_add
parent1818cc94fbfa7ec971a4ea2205486dbaf1d30271 (diff)
move compare into LibSpec, it's not so specific to Signature after all
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/LibSpec.pm15
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Signature.pm17
2 files changed, 15 insertions, 17 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/LibSpec.pm b/usr.sbin/pkg_add/OpenBSD/LibSpec.pm
index bdff9e84fd5..ba1d0d5c766 100644
--- a/usr.sbin/pkg_add/OpenBSD/LibSpec.pm
+++ b/usr.sbin/pkg_add/OpenBSD/LibSpec.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: LibSpec.pm,v 1.12 2010/06/30 10:51:04 espie Exp $
+# $OpenBSD: LibSpec.pm,v 1.13 2010/07/11 10:05:18 espie Exp $
#
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
#
@@ -290,4 +290,17 @@ sub match
return !$spec->no_match($library, $base);
}
+sub compare
+{
+ my ($a, $b) = @_;
+
+ if ($a->key ne $b->key) {
+ return undef;
+ }
+ if ($a->major != $b->major) {
+ return $a->major <=> $b->major;
+ }
+ return $a->minor <=> $b->minor;
+}
+
1;
diff --git a/usr.sbin/pkg_add/OpenBSD/Signature.pm b/usr.sbin/pkg_add/OpenBSD/Signature.pm
index b4cd10312a4..b6628b746dd 100644
--- a/usr.sbin/pkg_add/OpenBSD/Signature.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Signature.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Signature.pm,v 1.8 2010/06/30 10:51:04 espie Exp $
+# $OpenBSD: Signature.pm,v 1.9 2010/07/11 10:05:18 espie Exp $
#
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
#
@@ -170,19 +170,4 @@ sub compare
return $r;
}
-package OpenBSD::LibSpec;
-
-sub compare
-{
- my ($a, $b) = @_;
-
- if ($a->key ne $b->key) {
- return undef;
- }
- if ($a->major != $b->major) {
- return $a->major <=> $b->major;
- }
- return $a->minor <=> $b->minor;
-}
-
1;