diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-07-18 12:00:22 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-07-18 12:00:22 +0000 |
commit | beb8886edd5ae075dd280187280e6e8300a1d5d9 (patch) | |
tree | dfdb1d6ec9c3ed5ffe9efb46ccd2f951c340309c /usr.sbin | |
parent | 31edaca1c2da46c593c40c3c8d8c645a0269f7f2 (diff) |
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...
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/pkg_delete | 12 |
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"; |