# ex:ts=8 sw=4:
-# $OpenBSD: Add.pm,v 1.136 2014/01/07 10:22:05 espie Exp $
+# $OpenBSD: Add.pm,v 1.137 2014/01/07 13:26:17 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
$self->fullname, $dest, $!);
}
+sub install
+{
+ my ($self, $state) = @_;
+ if (!$state->{extracted_first}) {
+ $self->may_verify_digest($state);
+ }
+}
+
package OpenBSD::PackingElement::FCONTENTS;
sub copy_info
{
# ex:ts=8 sw=4:
-# $OpenBSD: PackingElement.pm,v 1.220 2014/01/04 14:14:55 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.221 2014/01/07 13:26:18 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
&OpenBSD::PackingElement::UniqueOption::new;
}
+sub may_verify_digest
+{
+ my ($self, $state) = @_;
+ if (!$state->{check_digest}) {
+ return;
+ }
+ if (!defined $self->{d}) {
+ $state->log->fatal($state->f("#1 does not have a signature",
+ $self->fullname));
+ }
+ my $d = $self->compute_digest($self->fullname);
+ if (!$d->equals($self->{d})) {
+ $state->log->fatal($state->f("checksum for #1 does not match",
+ $self->fullname));
+ }
+ if ($state->verbose >= 3) {
+ $state->say("Checksum match for #1", $self->fullname);
+ }
+}
+
package OpenBSD::PackingElement::FCONTENTS;
our @ISA=qw(OpenBSD::PackingElement::SpecialFile);
sub name() { OpenBSD::PackageInfo::CONTENTS }
{
}
+# CONTENTS doesn't have a checksum
+sub may_verify_digest
+{
+}
package OpenBSD::PackingElement::FCOMMENT;
our @ISA=qw(OpenBSD::PackingElement::SpecialFile);
sub name() { OpenBSD::PackageInfo::COMMENT }
# ex:ts=8 sw=4:
-# $OpenBSD: Replace.pm,v 1.84 2012/04/28 12:00:10 espie Exp $
+# $OpenBSD: Replace.pm,v 1.85 2014/01/07 13:26:18 espie Exp $
#
# Copyright (c) 2004-2010 Marc Espie <espie@openbsd.org>
#
{
}
+package OpenBSD::PackingElement::SpecialFile;
+sub extract
+{
+ my ($self, $state) = @_;
+ $self->may_verify_digest($state);
+}
+
package OpenBSD::PackingElement::Exec;
sub update_issue
{