diff options
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageLocator.pm | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm index 1df041e61fc..79680c203f9 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm @@ -1,4 +1,4 @@ -# $OpenBSD: PackageLocator.pm,v 1.7 2004/01/28 22:30:50 espie Exp $ +# $OpenBSD: PackageLocator.pm,v 1.8 2004/03/07 19:29:08 espie Exp $ # # Copyright (c) 2003 Marc Espie. # @@ -111,6 +111,11 @@ sub open return $fh; } +# by default, we don't know how to list packages there. +sub simplelist +{ +} + package OpenBSD::PackageLocation::SCP; our @ISA=qw(OpenBSD::PackageLocation OpenBSD::PackageLocation::FTPorSCP); @@ -158,16 +163,22 @@ sub list { my $self = shift; my @l = (); - opendir(my $dir, $self->{location}) or return undef; + my $dname = $self->{location}; + opendir(my $dir, $dname) or return undef; while (my $e = readdir $dir) { - next unless -f "$dir/$e"; - next unless $e = ~ m/\.tgz$/; + next unless -f "$dname/$e"; + next unless $e =~ m/\.tgz$/; push(@l, $`); } close($dir); return @l; } +sub simplelist +{ + return $_[0]->list(); +} + package OpenBSD::PackageLocation::FTPorSCP; sub _list @@ -313,6 +324,15 @@ sub find return $package; } +sub available +{ + my @l = (); + foreach my $loc (@pkgpath) { + push(@l, $loc->simplelist()); + } + return @l; +} + sub info { my $self = shift; |