tied items so we can still skip extracting them.
better than the stopgap measure I committed a few weeks ago.
# ex:ts=8 sw=4:
-# $OpenBSD: Add.pm,v 1.171 2016/08/12 11:17:37 espie Exp $
+# $OpenBSD: Add.pm,v 1.172 2016/08/27 18:17:46 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
sub find_extractible
{
my ($self, $state, $wanted, $tied) = @_;
- if ($self->{tieto} && !$state->{delete_first}
- || $self->{link} || $self->{symlink}) {
+ if ($self->{tieto} || $self->{link} || $self->{symlink}) {
$tied->{$self->name} = $self;
} else {
$wanted->{$self->name} = $self;
# ex:ts=8 sw=4:
-# $OpenBSD: Delete.pm,v 1.145 2016/02/03 18:30:15 robert Exp $
+# $OpenBSD: Delete.pm,v 1.146 2016/08/27 18:17:46 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
$state->say("deleting: #1", $realname);
}
return if $state->{not};
- if (!unlink $realname) {
- $state->errsay("Problem deleting #1: #2", $realname, $!);
- $state->log("deleting #1 failed: #2", $realname, $!);
+ if ($state->{delete_first} && $self->{tied}) {
+ push(@{$state->{delayed}}, $realname);
+ } else {
+ if (!unlink $realname) {
+ $state->errsay("Problem deleting #1: #2", $realname,
+ $!);
+ $state->log("deleting #1 failed: #2", $realname, $!);
+ }
}
}
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgAdd.pm,v 1.88 2015/10/07 17:52:38 jmc Exp $
+# $OpenBSD: PkgAdd.pm,v 1.89 2016/08/27 18:17:46 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
# Here there should be code to handle old libs
}
+sub delayed_delete
+{
+ my $state = shift;
+ for my $realname (@{$state->{delayed}}) {
+ if (!unlink $realname) {
+ $state->errsay("Problem deleting #1: #2", $realname,
+ $!);
+ $state->log("deleting #1 failed: #2", $realname, $!);
+ }
+ }
+ delete $state->{delayed};
+}
+
sub really_add
{
my ($set, $state) = @_;
$handle->pkgname." failed", $set, $state));
}
}
- if (!$state->{delete_first}) {
+ if ($state->{delete_first}) {
+ delayed_delete($state);
+ } else {
$state->{hardkill} = 1;
delete_old_packages($set, $state);
}