summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackingElement.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm25
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);