diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2006-03-04 11:31:19 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2006-03-04 11:31:19 +0000 |
commit | 3d690a93ced317bfbed33aa806263a506af1c566 (patch) | |
tree | 6d4f20643ad9ebb6376b90da0bbbbc3e55356bfb /usr.sbin/pkg_add/OpenBSD/PackageName.pm | |
parent | 9b35e98df2d4fcebc393c744ad750804061c88bd (diff) |
reorganize code a little bit: Update.pm becomes Replace.pm (since it matches
the -r option), and the find_update code moves to Update.pm, so that it doesn't
get parsed if -u is not used.
Also make the has_new_sig and uses_old_libs local methods of PackingList,
as it is their natural API.
Reorg a few more routines so that they can be found by pkg_add and by
Update.pm.
May need to split off more stuff to avoid parsing everything...
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackageName.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageName.pm | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageName.pm b/usr.sbin/pkg_add/OpenBSD/PackageName.pm index 4805d3596ca..2401a7e087c 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageName.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageName.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageName.pm,v 1.9 2005/08/29 00:42:58 espie Exp $ +# $OpenBSD: PackageName.pm,v 1.10 2006/03/04 11:31:18 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -121,6 +121,21 @@ sub compile_stemlist bless $hash, "OpenBSD::PackageLocator::_compiled_stemlist"; } +sub available_stems +{ + my $state = shift; + my @avail = OpenBSD::PackageLocator::available(); + if (@avail == 0) { + require OpenBSD::Error; + + OpenBSD::Error::Warn("No packages available in the PKG_PATH\n"); + } + unless ($state->{forced}->{allversions}) { + @avail = OpenBSD::PackageName::keep_most_recent(@avail); + } + return OpenBSD::PackageName::compile_stemlist(@avail); +} + package OpenBSD::PackageLocator::_compiled_stemlist; sub findstem |