diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2008-06-11 09:42:14 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2008-06-11 09:42:14 +0000 |
commit | de20fbecd0e467378671e67e2060a7f0c83b1468 (patch) | |
tree | e6e41f5135b70f246f3071497d1a9f68bca4e9f6 /usr.sbin/pkg_add/OpenBSD/PackingElement.pm | |
parent | b7812bf00b0f25ded04d672bea4560ecc82d0205 (diff) |
let elements be responsible for computing their own md5 (allows special
behavior for @bin object).
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackingElement.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index dec07fc226e..a707dd14534 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.146 2008/06/06 14:49:21 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.147 2008/06/11 09:42:13 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -250,6 +250,13 @@ sub realname return $state->{destdir}.$name; } +sub compute_md5 +{ + my ($self, $filename) = @_; + require OpenBSD::md5; + return OpenBSD::md5::fromfile($filename); +} + # exec/unexec and friends package OpenBSD::PackingElement::Action; our @ISA=qw(OpenBSD::PackingElement::Object); @@ -1312,23 +1319,26 @@ sub exec_on_delete { 0 } sub add_md5 { - my ($self, $md5) = @_; - $self->{md5} = $md5; + &OpenBSD::PackingElement::FileBase::add_md5; } sub add_size { - my ($self, $sz) = @_; - $self->{size} = $sz; + &OpenBSD::PackingElement::FileBase::add_size; } -sub needs_keyword { 0 } +sub compute_md5 +{ + &OpenBSD::PackingElement::FileObject::compute_md5; +} sub write { &OpenBSD::PackingElement::FileBase::write; } +sub needs_keyword { 0 } + sub add_object { my ($self, $plist) = @_; |