summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-03-11 18:54:07 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-03-11 18:54:07 +0000
commitfe36baf3bd08d66ecd39cf20d7ab7997d99d81ba (patch)
tree3fe36bb5b55335c5c1bbbb13cb8e235d9cf3f4d3 /usr.sbin
parent75e9a0eee45619868964aa0be16ddb5adb30df35 (diff)
repair pkg_add -, by making sure `-' is a special object.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageLocator.pm17
1 files changed, 15 insertions, 2 deletions
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;
}