From d65fc2ff1a2df60865de3844fb217a024a7a33bd Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 20 Oct 2015 16:12:00 -0200 Subject: Teach get_pkg_info() to deal with an array of packages --- src/etc/inc/pkg-utils.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/etc') diff --git a/src/etc/inc/pkg-utils.inc b/src/etc/inc/pkg-utils.inc index ce01fb6..63286c2 100644 --- a/src/etc/inc/pkg-utils.inc +++ b/src/etc/inc/pkg-utils.inc @@ -388,11 +388,16 @@ function get_pkg_info($pkgs = 'all', $info = 'all') { $out = ''; $err = ''; + unset($pkg_filter); + if (is_array($pkgs)) { + $pkg_filter = $pkgs; + $pkgs = 'all'; + } + if ($pkgs == 'all') { $pkgs = $g['pkg_prefix']; } - /* Make sure repo metadata is up2date */ $static_output .= "\n" . gettext("Updating package repository metadada...") . "\n"; update_status($static_output); @@ -424,6 +429,10 @@ function get_pkg_info($pkgs = 'all', $info = 'all') { continue; } + if (isset($pkg_filter) && !in_array($pkg_info['name'], $pkg_filter)) { + continue; + } + $pkg_info['desc'] = preg_replace('/\n+WWW:.*$/', '', $pkg_info['desc']); $result[] = $pkg_info; -- cgit v1.1