diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2008-06-06 14:49:22 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2008-06-06 14:49:22 +0000 |
commit | 23586a3f708c1968c0e44ebd161662e3c1b816ce (patch) | |
tree | a04757b6a52b52e8a98d5118dd82fb81bc69a3f7 /usr.sbin | |
parent | 199ccd4de410849cd37ff474bd38e5808513b888 (diff) |
@wantlib elements become checksummable
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 25 |
1 files changed, 23 insertions, 2 deletions
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 <espie@openbsd.org> # @@ -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); |