From fe36baf3bd08d66ecd39cf20d7ab7997d99d81ba Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Thu, 11 Mar 2004 18:54:07 +0000 Subject: repair pkg_add -, by making sure `-' is a special object. --- usr.sbin/pkg_add/OpenBSD/PackageLocator.pm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'usr.sbin/pkg_add/OpenBSD/PackageLocator.pm') diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm index 79680c203f9..4028725571a 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.8 2004/03/07 19:29:08 espie Exp $ +# $OpenBSD: PackageLocator.pm,v 1.9 2004/03/11 18:54:06 espie Exp $ # # Copyright (c) 2003 Marc Espie. # @@ -179,6 +179,19 @@ sub simplelist return $_[0]->list(); } +package OpenBSD::PackageLocation::Local::Pipe; +our @ISA=qw(OpenBSD::PackageLocation::Local); + +sub may_exist +{ + return 1; +} + +sub pipename +{ + return "gzip -d -c -q -f 2>/dev/null -"; +} + package OpenBSD::PackageLocation::FTPorSCP; sub _list @@ -296,7 +309,7 @@ sub find local $_ = shift; if ($_ eq '-') { - my $location = OpenBSD::PackageLocation->new('-'); + my $location = OpenBSD::PackageLocation::Local::Pipe->_new('./'); my $package = $class->openAbsolute($location, ''); return $package; } -- cgit v1.2.3