From 23586a3f708c1968c0e44ebd161662e3c1b816ce Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Fri, 6 Jun 2008 14:49:22 +0000 Subject: @wantlib elements become checksummable --- usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index 5e8fcecd83b..dec07fc226e 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.145 2008/05/31 11:53:46 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.146 2008/06/06 14:49:21 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie # @@ -322,6 +322,7 @@ sub destate my ($self, $state) = @_; $self->SUPER::destate($state); $state->{lastfile} = $self; + $state->{lastchecksummable} = $self; $self->compute_modes($state); if (defined $state->{nochecksum}) { $self->{nochecksum} = 1; @@ -576,7 +577,7 @@ sub add { my ($class, $plist, $args) = @_; - $plist->{state}->{lastfile}->add_md5(pack('H*', $args)); + $plist->{state}->{lastchecksummable}->add_md5(pack('H*', $args)); return; } @@ -803,6 +804,26 @@ sub category() { "wantlib" } sub keyword() { "wantlib" } __PACKAGE__->register_with_factory; +sub destate +{ + my ($self, $state) = @_; + $state->{lastchecksummable} = $self; +} + +sub write +{ + my ($self, $fh) = @_; + $self->SUPER::write($fh); + if (defined $self->{md5}) { + print $fh "\@md5 ", unpack('H*', $self->{md5}), "\n"; + } +} + +sub add_md5 +{ + &OpenBSD::PackingElement::FileBase::add_md5; +} + package OpenBSD::PackingElement::PkgPath; our @ISA=qw(OpenBSD::PackingElement::Meta); -- cgit v1.2.3