diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2010-01-01 13:41:50 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2010-01-01 13:41:50 +0000 |
commit | 4fc81b18279df5f22bcc3ea85726c11313abcd8d (patch) | |
tree | 96ffe9cf95a1ba4b833abb318ae976262d9e445d /usr.sbin | |
parent | e59d685aaf7437f5be2cdfab00c0fba50557809e (diff) |
explicit-update support
(also url support, but commented out for now)
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Update.pm | 18 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 3 |
2 files changed, 19 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm index 8d924c8371b..37e3efc8506 100644 --- a/usr.sbin/pkg_add/OpenBSD/Update.pm +++ b/usr.sbin/pkg_add/OpenBSD/Update.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Update.pm,v 1.124 2010/01/01 13:00:05 espie Exp $ +# $OpenBSD: Update.pm,v 1.125 2010/01/01 13:41:49 espie Exp $ # # Copyright (c) 2004-2010 Marc Espie <espie@openbsd.org> # @@ -100,6 +100,18 @@ sub process_handle Fatal("Can't locate $pkgname"); } + if ($plist->has('explicit-update') && $state->{allupdates}) { + $h->{update_found} = $h; + $set->move_kept($h); + return 0; + } + +# if (defined $plist->{url}) { +# require OpenBSD::PackageLocator; +# my $repo; +# ($repo, undef, undef) = OpenBSD::PackageLocator::path_parse($plist->{url}->name); +# $set->add_repositories($repo); +# } my @search = (); my $sname = $pkgname; @@ -148,6 +160,10 @@ sub process_handle next; } } + if ($p2->has('explicit-update') && $state->{allupdates}) { + $oldfound = 1; + next; + } if ($plist->signature eq $p2->signature) { $found = $handle; push(@l2, $handle); diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index cc5ee613023..aeee39cf2ba 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.456 2010/01/01 11:49:55 espie Exp $ +# $OpenBSD: pkg_add,v 1.457 2010/01/01 13:41:49 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org> # @@ -920,6 +920,7 @@ sub process_parameters if (@ARGV == 0) { @ARGV = sort(installed_packages()); + $state->{allupdates} = 1; } my $inst = OpenBSD::PackageRepository::Installed->new; for my $pkgname (@ARGV) { |