Remove empty items from output

This commit is contained in:
Renato Botelho 2017-11-10 14:18:46 -02:00
parent 8d5ff32b7a
commit c253e3520b

View File

@ -390,7 +390,7 @@ function get_pkg_info($pkgs = 'all', $remote_repo_usage_disabled = false,
"search {$extra_param}-R --raw-format json-compact " .
$pkgs, $search_out, $search_err);
if ($search_rc == 0) {
$search_items = explode("\n", $search_out);
$search_items = explode("\n", chop($search_out));
array_walk($search_items, function(&$v, &$k) {
$v = json_decode($v, true);
});
@ -408,7 +408,7 @@ function get_pkg_info($pkgs = 'all', $remote_repo_usage_disabled = false,
$info_rc = pkg_exec("info -R --raw-format json-compact " .
$pkgs, $info_out, $info_err);
if ($info_rc == 0) {
$info_items = explode("\n", $info_out);
$info_items = explode("\n", chop($info_out));
array_walk($info_items, function(&$v, &$k) {
$v = json_decode($v, true);
});