diff options
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageLocator.pm | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm index cfa0d0e1de8..44684370f6e 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageLocator.pm,v 1.27 2005/09/13 19:40:30 espie Exp $ +# $OpenBSD: PackageLocator.pm,v 1.28 2005/09/13 20:03:29 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -125,6 +125,43 @@ sub grabPlist return $self->grabPlist($name, $arch, $code); } +package OpenBSD::PackageRepository::Installed; +use OpenBSD::PackageInfo; + +sub find +{ + my ($repository, $name, $arch) = @_; + my $self; + + if (is_installed($name)) { + $self = OpenBSD::PackageLocation->new($repository, $name); + $self->{dir} = installed_info($name); + } + return $self; +} + +sub grabPlist +{ + my ($repository, $name, $arch, $code) = @_; + require OpenBSD::PackingList; + return OpenBSD::PackingList->from_installation($name, $code); +} + +sub available +{ + return installed_packages(); +} + +sub wipe_info +{ +} + +sub may_exist +{ + my ($self, $name) = @_; + return is_installed($name); +} + package OpenBSD::PackageRepository::SCP; our @ISA=qw(OpenBSD::PackageRepository OpenBSD::PackageRepository::FTPorSCP); |