summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2004-07-18 12:00:21 +0000
committerespie <espie@openbsd.org>2004-07-18 12:00:21 +0000
commit7fe6352137188b8e418f45ac244baa1377a45fb8 (patch)
treee475078d337bd025f2dba7745238b30c5f5d80c4
parentsync (diff)
downloadwireguard-openbsd-7fe6352137188b8e418f45ac244baa1377a45fb8.tar.xz
wireguard-openbsd-7fe6352137188b8e418f45ac244baa1377a45fb8.zip
when deleting @link, don't bother checking for md5, since we don't have any.
The check will have been done for the `parent' file anyways. noticed by krw@, seems all heavy-duty porters use -q, so we didn't notice it...
-rw-r--r--usr.sbin/pkg_add/pkg_delete12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/pkg_delete b/usr.sbin/pkg_add/pkg_delete
index 4928fa4e693..9ac3c9c4a75 100644
--- a/usr.sbin/pkg_add/pkg_delete
+++ b/usr.sbin/pkg_add/pkg_delete
@@ -1,6 +1,6 @@
#!/usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_delete,v 1.25 2004/07/14 10:44:03 espie Exp $
+# $OpenBSD: pkg_delete,v 1.26 2004/07/18 12:00:21 espie Exp $
#
# Copyright (c) 2003 Marc Espie.
#
@@ -141,7 +141,11 @@ sub delete
print "deleting symlink: $realname\n";
}
} else {
- unless ($self->{nochecksum} or $state->{quick}) {
+ if (! -f $realname) {
+ print "File $realname does not exist\n";
+ return;
+ }
+ unless (defined($self->{link}) or $self->{nochecksum} or $state->{quick}) {
if (!defined $self->{md5}) {
print "Problem: $name does not have an md5 checksum\n";
print "NOT deleting: $realname\n";
@@ -149,10 +153,6 @@ sub delete
OpenBSD::Logger::log "rm $state->{destdirname}$name\n";
return;
}
- if (! -f $realname) {
- print "File $realname does not exist\n";
- return;
- }
my $md5 = OpenBSD::md5::fromfile($realname);
if ($md5 ne $self->{md5}) {
print "Problem: md5 doesn't match for $name\n";