summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2017-03-16 15:57:48 +0000
committerMarc Espie <espie@cvs.openbsd.org>2017-03-16 15:57:48 +0000
commite3fc38e4d045617e3baed53e3907926e5c73a8f2 (patch)
treeedffd35c08560bc74ee785f9d026771ba9310cbd /usr.sbin
parentaa6d8312472d3617920f218c4d194b67e59a18d7 (diff)
tied files should be treated like deleted files wrt checksums.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgAdd.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
index 68c0d9a5dbf..7177f7f9812 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgAdd.pm,v 1.94 2017/03/13 11:36:23 espie Exp $
+# $OpenBSD: PkgAdd.pm,v 1.95 2017/03/16 15:57:47 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@@ -89,9 +89,16 @@ sub tie_files
if (defined $sha->{$self->{d}->key}) {
my $tied = $sha->{$self->{d}->key};
# don't tie if there's a problem with the file
- return unless -f $tied->realname($state);
+ my $realname = $tied->realname($state);
+ return unless -f $realname;
# and do a sanity check that this file wasn't altered
return unless (stat _)[7] == $self->{size};
+ if (!$state->{quick}) {
+ my $d = $self->compute_digest($realname, $self->{d});
+ # XXX we don't have to display anything here
+ # because delete will take care of that
+ return unless $d->equals($self->{d});
+ }
$self->{tieto} = $tied;
$tied->{tied} = 1;
$state->say("Tieing #1 to #2", $self->stringize,