From beb8886edd5ae075dd280187280e6e8300a1d5d9 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sun, 18 Jul 2004 12:00:22 +0000 Subject: 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... --- usr.sbin/pkg_add/pkg_delete | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'usr.sbin') 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"; -- cgit v1.2.3