summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-05-14 10:24:59 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-05-14 10:24:59 +0000
commite3d4985d59c4b03b373e02166f761960c5376cf9 (patch)
treeb134916352e8ee39ee37d581f2afebcf27475dc7
parent9573170d1770e6dc74b7cc19b2cecb6c60a5da85 (diff)
two repos: new(1) gives all packages. new() zaps .libs and friends.
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm
index e82c5106ad1..b621d71a77c 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Installed.pm,v 1.2 2007/05/14 10:19:01 espie Exp $
+# $OpenBSD: Installed.pm,v 1.3 2007/05/14 10:24:58 espie Exp $
#
# Copyright (c) 2007 Marc Espie <espie@openbsd.org>
#
@@ -44,10 +44,11 @@ use OpenBSD::PackageInfo (qw(is_installed installed_info
installed_packages installed_stems));
my $singleton = bless {}, __PACKAGE__;
+my $s2 = bless {all => 1}, __PACKAGE__;
sub new
{
- return $singleton;
+ return $_[1] ? $s2 : $singleton;
}
sub find
@@ -73,12 +74,14 @@ sub grabPlist
sub available
{
- return installed_packages();
+ my $self = shift;
+ return installed_packages($self->{all});
}
sub list
{
- my @list = installed_packages();
+ my $self = shift;
+ my @list = installed_packages($self->{all});
return \@list;
}