summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2008-06-18 12:05:01 +0000
committerMarc Espie <espie@cvs.openbsd.org>2008-06-18 12:05:01 +0000
commit2137f66f26456d35e5f956ecfab03d898cd6a53c (patch)
tree90bdcc5f9848c9cab08f63b87f4f60fc04ffb6f0 /usr.sbin/pkg_add
parentc9d5d9cd6231c9897430dd59ed6181289fac2504 (diff)
use path_parse to retrieve pkg_info anywhere
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/pkg_info13
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/pkg_info b/usr.sbin/pkg_add/pkg_info
index 6a4a861e25c..ef79a64a4ac 100644
--- a/usr.sbin/pkg_add/pkg_info
+++ b/usr.sbin/pkg_add/pkg_info
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_info,v 1.67 2008/06/15 08:24:28 espie Exp $
+# $OpenBSD: pkg_info,v 1.68 2008/06/18 12:05:00 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -104,7 +104,16 @@ sub find_pkg
}
require OpenBSD::PackageLocator;
- find_pkg_in('OpenBSD::PackageLocator', $pkgname, $code);
+ my ($repo, $path);
+
+ if ($pkgname =~ m/\//o) {
+ ($repo, $path, $pkgname) =
+ OpenBSD::PackageLocator::path_parse($pkgname);
+ } else {
+ $repo = 'OpenBSD::PackageLocator';
+ }
+
+ find_pkg_in($repo, $pkgname, $code);
}
sub printfile