From 2137f66f26456d35e5f956ecfab03d898cd6a53c Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Wed, 18 Jun 2008 12:05:01 +0000 Subject: use path_parse to retrieve pkg_info anywhere --- usr.sbin/pkg_add/pkg_info | 13 +++++++++++-- 1 file 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 # @@ -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 -- cgit v1.2.3