summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-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";