diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2010-01-09 17:44:22 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2010-01-09 17:44:22 +0000 |
commit | 2b0b9e6678db5218af464e10855bfc5c25430ece (patch) | |
tree | dbf6cac74663f64f6f22bd05888d3dfb810e0544 /usr.sbin/pkg_add/OpenBSD/PackingElement.pm | |
parent | c8a56e9339064aeedad16623c7ebd41acdef7351 (diff) |
build signature objects that we will be able to compare
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackingElement.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index d6aa9401a8b..ab66cc72b44 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingElement.pm,v 1.170 2010/01/05 17:53:23 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.171 2010/01/09 17:44:21 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org> # @@ -315,12 +315,6 @@ sub category package OpenBSD::PackingElement::Depend; our @ISA=qw(OpenBSD::PackingElement::Meta); -sub signature -{ - my ($self, $hash) = @_; - $hash->{$self->name} = 1; -} - # Abstract class for all file-like elements package OpenBSD::PackingElement::FileBase; our @ISA=qw(OpenBSD::PackingElement::FileObject); @@ -922,6 +916,12 @@ sub stringize (qw(pkgpath pattern def))); } +sub signature +{ + my ($self, $hash) = @_; + $hash->{$self->{pkgpath}} = OpenBSD::PackageName->from_string($self->{def}); +} + OpenBSD::Auto::cache(spec, sub { require OpenBSD::Search; @@ -958,6 +958,16 @@ sub add_digest &OpenBSD::PackingElement::FileBase::add_digest; } +sub signature +{ + my ($self, $hash) = @_; + require OpenBSD::SharedLibs; + + if (my ($stem, $major, $minor) = OpenBSD::SharedLibs::parse_spec($self->name)) { + $hash->{$stem} = OpenBSD::LibrarySpec->new($stem, $major, $minor); + } +} + package OpenBSD::PackingElement::PkgPath; our @ISA=qw(OpenBSD::PackingElement::Meta); |