diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2008-06-18 12:05:01 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2008-06-18 12:05:01 +0000 |
commit | 2137f66f26456d35e5f956ecfab03d898cd6a53c (patch) | |
tree | 90bdcc5f9848c9cab08f63b87f4f60fc04ffb6f0 /usr.sbin/pkg_add | |
parent | c9d5d9cd6231c9897430dd59ed6181289fac2504 (diff) |
use path_parse to retrieve pkg_info anywhere
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/pkg_info | 13 |
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 |