summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-05-31 10:04:04 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-05-31 10:04:04 +0000
commitee5b69e63140ed7263ccc94ffbd034557b444d6f (patch)
tree28a985048fb8edf8bc257be45266f05a43b42696 /usr.sbin/pkg_add
parent7f95143f980038a332f0756e4bd91359566e262f (diff)
fix the saving of partial installs in case destdir is used.
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm11
-rw-r--r--usr.sbin/pkg_add/pkg_add10
2 files changed, 8 insertions, 13 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index 0e042c12e98..b0447d0a7ec 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.66 2007/05/30 16:32:14 espie Exp $
+# $OpenBSD: Add.pm,v 1.67 2007/05/31 10:04:03 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -68,7 +68,7 @@ sub validate_plist
sub record_partial_installation
{
- my ($plist, $h) = @_;
+ my ($plist, $state, $h) = @_;
use OpenBSD::PackingElement;
@@ -82,12 +82,7 @@ sub record_partial_installation
require OpenBSD::md5;
my $old = $last->{md5};
- my $lastname;
- if (defined $last->{tempname}) {
- $lastname = $last->{tempname};
- } else {
- $lastname = $last->fullname;
- }
+ my $lastname = $last->realname($state);
$last->{md5} = OpenBSD::md5::fromfile($lastname);
if ($old ne $last->{md5}) {
print "Adjusting md5 for $lastname from ",
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index 8c5a89edaf1..3d664dc0e81 100644
--- a/usr.sbin/pkg_add/pkg_add
+++ b/usr.sbin/pkg_add/pkg_add
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_add,v 1.295 2007/05/30 16:32:14 espie Exp $
+# $OpenBSD: pkg_add,v 1.296 2007/05/31 10:04:03 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -310,13 +310,13 @@ sub failed_message
sub save_partial_set
{
- my ($set, $not) = @_;
+ my ($set, $state) = @_;
- return () if $not;
+ return () if $state->{not};
my @l = ();
for my $h ($set->newer) {
next unless defined $h->{partial};
- push(@l, OpenBSD::Add::record_partial_installation($h->{plist}, $h->{partial}));
+ push(@l, OpenBSD::Add::record_partial_installation($h->{plist}, $state, $h->{partial}));
}
return @l;
}
@@ -324,7 +324,7 @@ sub save_partial_set
sub partial_install
{
my ($base_msg, $set, $state) = @_;
- return failed_message($base_msg, $state->{interrupted}, save_partial_set($set, $state->{not}));
+ return failed_message($base_msg, $state->{interrupted}, save_partial_set($set, $state));
}
sub really_add