summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-08-07 21:19:05 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-08-07 21:19:05 +0000
commit0f2abeb396a84845a7e606c86f416f7694e336eb (patch)
treea1bd0db58bd917747f06dd15d3470dd6da9d818e /usr.sbin/pkg_add
parent64ca7c6d4737dfda3c57b25f3804fbd227199168 (diff)
nasty inversion of parameters, so that state did not get propagated correctly.
ended up calling './'->errsay in ArcCheck, which of course doesn't work, so a die() in the middle of a package install... compounded with file !existing, so that adjust checksum would fail, and so not even a partial install...
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm22
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageLocator.pm4
2 files changed, 15 insertions, 11 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index 451c18297e2..0b6426a8f5d 100644
--- a/usr.sbin/pkg_add/OpenBSD/Add.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Add.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Add.pm,v 1.114 2010/07/24 10:49:01 espie Exp $
+# $OpenBSD: Add.pm,v 1.115 2010/08/07 21:19:04 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -80,14 +80,18 @@ sub record_partial_installation
my $last = $n->{state}->{lastfile};
if (defined $last && defined($last->{d})) {
- my $old = $last->{d};
- my $lastname = $last->realname($state);
- $last->{d} = $last->compute_digest($lastname, $old);
- if (!$old->equals($last->{d})) {
- $state->say("Adjusting #1 for #2 from #3 to #4",
- $old->keyword, $lastname, $old->stringize,
- $last->{d}->stringize);
- }
+ my $old = $last->{d};
+ my $lastname = $last->realname($state);
+ if (-f $lastname) {
+ $last->{d} = $last->compute_digest($lastname, $old);
+ if (!$old->equals($last->{d})) {
+ $state->say("Adjusting #1 for #2 from #3 to #4",
+ $old->keyword, $lastname, $old->stringize,
+ $last->{d}->stringize);
+ }
+ } else {
+ undef $last->{d};
+ }
}
register_installation($n);
return $borked;
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
index 71d43931ae8..cc00ed6283b 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageLocator.pm,v 1.95 2010/07/02 12:42:49 espie Exp $
+# $OpenBSD: PackageLocator.pm,v 1.96 2010/08/07 21:19:04 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -55,7 +55,7 @@ sub default_path
sub path_parse
{
- my ($self, $pkgname, $path, $state) = (@_, './');
+ my ($self, $pkgname, $state, $path) = (@_, './');
if ($pkgname =~ m/^(.*[\/\:])(.*)/) {
($pkgname, $path) = ($2, $1);
}