Revision eaed7e74
Added by Renato Botelho almost 8 years ago
src/etc/inc/pkg-utils.inc | ||
---|---|---|
374 | 374 |
$extra_param = "-U "; |
375 | 375 |
} |
376 | 376 |
|
377 |
$did_search = false; |
|
377 | 378 |
$search_rc = 0; |
378 | 379 |
$info_rc = 0; |
379 | 380 |
$search_items = array(); |
... | ... | |
384 | 385 |
* we want up-to-date remote repo info then do a full pkg search |
385 | 386 |
*/ |
386 | 387 |
if (!$installed_pkgs_only || !$remote_repo_usage_disabled) { |
388 |
$did_search = true; |
|
387 | 389 |
$search_rc = pkg_exec( |
388 | 390 |
"search {$extra_param}-R --raw-format json-compact " . |
389 | 391 |
$pkgs, $search_out, $search_err); |
... | ... | |
430 | 432 |
} |
431 | 433 |
|
432 | 434 |
/* It was not possible to search, use local information only */ |
433 |
$use_rquery = false; |
|
434 |
if ($search_rc != 0) { |
|
435 |
$use_rquery = true; |
|
435 |
if ($search_rc != 0 || !$did_search) { |
|
436 | 436 |
$search_items = $info_items; |
437 | 437 |
} else { |
438 | 438 |
foreach ($info_items as $pkg_info) { |
... | ... | |
495 | 495 |
* version is not available. Lets try to collect it |
496 | 496 |
* using rquery if possible |
497 | 497 |
*/ |
498 |
if ($use_rquery) {
|
|
498 |
if ($search_rc != 0 || !$did_search) {
|
|
499 | 499 |
$rc = pkg_exec("rquery -U %v {$pkg_info['name']}", $out, $err); |
500 | 500 |
|
501 | 501 |
if ($rc == 0) { |
Also available in: Unified diff
Always do rquery when pkg search is not used