summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-12-29 13:58:19 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-12-29 13:58:19 +0000
commitaf74cc9ceaef74777c71e2f5a38d0bccbcf09539 (patch)
treebfb177dc1bb683085a9c12c64c4e9c7b74ae2114 /usr.sbin
parent26223fbd61afdc17c508b3fe872910b1906e8980 (diff)
move check for already installed UP, which allows me to deal with UpdateSet
and tracker globally to avoid loops.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Handle.pm17
-rw-r--r--usr.sbin/pkg_add/pkg_add17
2 files changed, 17 insertions, 17 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Handle.pm b/usr.sbin/pkg_add/OpenBSD/Handle.pm
index 9cdb1a1866b..3dc9128dfcc 100644
--- a/usr.sbin/pkg_add/OpenBSD/Handle.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Handle.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Handle.pm,v 1.13 2009/12/20 22:38:45 espie Exp $
+# $OpenBSD: Handle.pm,v 1.14 2009/12/29 13:58:18 espie Exp $
#
# Copyright (c) 2007-2009 Marc Espie <espie@openbsd.org>
#
@@ -199,21 +199,6 @@ sub get_plist
}
my $pkgname = $handle->{pkgname} = $plist->pkgname;
- if (is_installed($pkgname) &&
- (!$state->{allow_replacing} ||
- !$state->{defines}->{installed} &&
- !$plist->has_new_sig($state) &&
- !$plist->uses_old_libs)) {
- $handle->{tweaked} =
- OpenBSD::Add::tweak_package_status($pkgname, $state);
- $state->say("Not reinstalling $pkgname")
- if $state->verbose >= 2 and !$handle->{tweaked};
- $state->tracker->{installed}->{$pkgname} = 1;
- $location->close_now;
- $location->wipe_info;
- $handle->set_error(ALREADY_INSTALLED);
- return;
- }
if ($pkg ne '-') {
if (!defined $pkgname or $pkg ne $pkgname) {
$state->say("Package name is not consistent ???");
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index 0b1140515e7..4de93e3c10b 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.444 2009/12/28 21:29:42 espie Exp $
+# $OpenBSD: pkg_add,v 1.445 2009/12/29 13:58:18 espie Exp $
#
# Copyright (c) 2003-2009 Marc Espie <espie@openbsd.org>
#
@@ -170,6 +170,21 @@ sub complete
for my $n ($set->newer) {
$n->complete($state);
+ my $pkgname = $n->pkgname;
+ my $plist = $n->plist;
+ if (is_installed($pkgname) &&
+ (!$state->{allow_replacing} ||
+ !$state->{defines}->{installed} &&
+ !$plist->has_new_sig($state) &&
+ !$plist->uses_old_libs)) {
+ $n->{tweaked} =
+ OpenBSD::Add::tweak_package_status($pkgname, $state);
+ $state->say("Not reinstalling $pkgname")
+ if $state->verbose >= 2 and !$n->{tweaked};
+ $state->tracker->uptodate($set);
+ $state->tracker->{uptodate}->{$pkgname} = 1;
+ $n->cleanup(OpenBSD::Handle::ALREADY_INSTALLED);
+ }
return 1 if $n->has_error;
}
for my $o ($set->older) {