diff options
author | Renato Botelho <renato@netgate.com> | 2015-10-20 16:12:00 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-10-20 16:19:50 -0200 |
commit | d65fc2ff1a2df60865de3844fb217a024a7a33bd (patch) | |
tree | ad657d6c3d0088084ac12f626dba5912b489a210 | |
parent | c8cae8e5f7c35de1015f75bf973788b6750f685f (diff) | |
download | pfsense-d65fc2ff1a2df60865de3844fb217a024a7a33bd.zip pfsense-d65fc2ff1a2df60865de3844fb217a024a7a33bd.tar.gz |
Teach get_pkg_info() to deal with an array of packages
-rw-r--r-- | src/etc/inc/pkg-utils.inc | 11 |
1 files changed, 10 insertions, 1 deletions
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; |