summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2003-11-06 17:59:24 +0000
committerMarc Espie <espie@cvs.openbsd.org>2003-11-06 17:59:24 +0000
commitdc92b6ab97e227535044f9fcb0e42c7c4515f43f (patch)
tree66c7dab3e82bc6624763baa1f88c0c1f7b1c1051 /usr.sbin/pkg_add/OpenBSD
parentd6c500a243aecc271b6a050d902fdc8f84c4e2b3 (diff)
Handle pkg_add -
let pkg_add postpone conflict handling until it has the real name of the package if necessary, and let PackageLocator deal correctly with a '-' filename.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageLocator.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
index d4734f05965..0689b9c9600 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.4 2003/10/31 18:42:51 espie Exp $
+# $OpenBSD: PackageLocator.pm,v 1.5 2003/11/06 17:59:23 espie Exp $
#
# Copyright (c) 2003 Marc Espie.
#
@@ -94,7 +94,7 @@ sub open
{
my ($self, $name) = @_;
my $fullname = $self->{location}.$name;
- open(my $fh, '-|', "gzip -d -c -q 2>/dev/null $fullname") or return undef;
+ open(my $fh, '-|', "gzip -d -c -q -f 2>/dev/null $fullname") or return undef;
return $fh;
}
@@ -200,6 +200,13 @@ sub find
{
my $class = shift;
local $_ = shift;
+
+ if ($_ eq '-') {
+ my $location = OpenBSD::PackageLocation->new('-');
+ my $package = openAbsolute($location, '');
+ bless $package, $class;
+ return $package;
+ }
$_.=".tgz" unless m/\.tgz$/;
if (exists $packages{$_}) {
return $packages{$_};