summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm8
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Delete.pm8
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgAdd.pm33
-rw-r--r--usr.sbin/pkg_add/OpenBSD/UpdateSet.pm4
4 files changed, 30 insertions, 23 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index e4fff12d87b..f68af073195 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.162 2014/11/21 15:07:09 espie Exp $
+# $OpenBSD: Add.pm,v 1.163 2014/11/25 14:16:15 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@@ -694,7 +694,7 @@ sub install
{
my ($self, $state) = @_;
$self->SUPER::install($state);
- if (!$state->{knownmandirs}{$self->fullname}) {
+ if (!$state->{current_set}{known_mandirs}{$self->fullname}) {
$state->log("You may wish to add #1 to /etc/man.conf",
$self->fullname);
}
@@ -883,7 +883,7 @@ sub install
{
my ($self, $state) = @_;
my $d = $self->{d};
- if (!$state->{known_displays}{$self->{d}->key}) {
+ if (!$state->{current_set}{known_displays}{$self->{d}->key}) {
$self->prepare($state);
}
$self->SUPER::install($state);
@@ -893,7 +893,7 @@ package OpenBSD::PackingElement::FUNDISPLAY;
sub find_extractible
{
my ($self, $state, $wanted, $tied) = @_;
- $state->{known_displays}{$self->{d}->key} = 1;
+ $state->{current_set}{known_displays}{$self->{d}->key} = 1;
$self->SUPER::find_extractible($state, $wanted, $tied);
}
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm
index 20c79375754..da6b5877c88 100644
--- a/usr.sbin/pkg_add/OpenBSD/Delete.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Delete.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Delete.pm,v 1.139 2014/11/21 15:07:09 espie Exp $
+# $OpenBSD: Delete.pm,v 1.140 2014/11/25 14:16:15 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@@ -679,7 +679,7 @@ package OpenBSD::PackingElement::FDISPLAY;
sub delete
{
my ($self, $state) = @_;
- $state->{known_displays}{$self->{d}->key} = 1;
+ $state->{current_set}{known_displays}{$self->{d}->key} = 1;
$self->SUPER::delete($state);
}
@@ -688,7 +688,7 @@ sub delete
{
my ($self, $state) = @_;
my $d = $self->{d};
- if (!$state->{known_displays}{$self->{d}->key}) {
+ if (!$state->{current_set}{known_displays}{$self->{d}->key}) {
$self->prepare($state);
}
$self->SUPER::delete($state);
@@ -698,7 +698,7 @@ package OpenBSD::PackingElement::Mandir;
sub delete
{
my ($self, $state) = @_;
- $state->{knownmandirs}{$self->fullname} = 1;
+ $state->{current_set}{known_mandirs}{$self->fullname} = 1;
$self->SUPER::delete($state);
}
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
index 9a3a79f5cc7..60e0c7bdf1e 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgAdd.pm,v 1.76 2014/11/21 15:07:09 espie Exp $
+# $OpenBSD: PkgAdd.pm,v 1.77 2014/11/25 14:16:15 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@@ -774,9 +774,6 @@ sub really_add
if ($set->older_to_do) {
$replacing = 1;
}
-# if (defined $plist->{old_libs}) {
-# $replacing = 1;
-# }
$state->{replacing} = $replacing;
my $handler = sub {
@@ -923,10 +920,27 @@ sub newer_is_bad_arch
return 0;
}
+sub may_tie_files
+{
+ my ($set, $state) = @_;
+ if ($set->newer > 0 && $set->older_to_do > 0 && !$state->defines('donttie')) {
+ my $sha = {};
+
+ for my $o ($set->older_to_do) {
+ $o->{plist}->hash_files($sha, $state);
+ }
+ for my $n ($set->newer) {
+ $n->{plist}->tie_files($sha, $state);
+ }
+ }
+}
+
sub process_set
{
my ($self, $set, $state) = @_;
+ $state->{current_set} = $set;
+
if (!$state->updater->process_set($set, $state)) {
return ();
}
@@ -1026,16 +1040,7 @@ sub process_set
return ();
}
}
- if ($set->newer > 0 && $set->older_to_do > 0 && !$state->defines('donttie')) {
- my $sha = {};
-
- for my $o ($set->older_to_do) {
- $o->{plist}->hash_files($sha, $state);
- }
- for my $n ($set->newer) {
- $n->{plist}->tie_files($sha, $state);
- }
- }
+ may_tie_files($set, $state);
if ($set->newer > 0 || $set->older_to_do > 0) {
for my $h ($set->newer) {
$h->plist->set_infodir($h->location->info);
diff --git a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
index fbd058c202a..bf565bfab64 100644
--- a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
+++ b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: UpdateSet.pm,v 1.75 2014/02/04 18:06:01 espie Exp $
+# $OpenBSD: UpdateSet.pm,v 1.76 2014/11/25 14:16:15 espie Exp $
#
# Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org>
#
@@ -110,6 +110,8 @@ sub cleanup
$self->{errorinfo} //= $errorinfo;
}
delete $self->{solver};
+ delete $self->{known_mandirs};
+ delete $self->{known_displays};
$self->mark_as_finished;
}