summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorstilez <stilez@users.noreply.github.com>2017-01-22 10:33:37 +0000
committerRenato Botelho <renato@netgate.com>2017-01-30 13:33:26 -0200
commit5e446a2510683917bb3c5079bb217211b16fd6a8 (patch)
tree2ca6c283543357eaee0fe8f8c70f041c7acb283c /src/usr
parent129a43703414ef81e95db39fe5e8762d1218e9b2 (diff)
downloadpfsense-5e446a2510683917bb3c5079bb217211b16fd6a8.zip
pfsense-5e446a2510683917bb3c5079bb217211b16fd6a8.tar.gz
get_pkg_info() fallback using pkg info if no local copy of repo catalog (resubmit)
Resubmit of PR #3157 with fix. The issue in #3157 was that `pkg info` and `pkg search`, undocumented in man pages, seem to handle things differently if no packages match the pattern string. `pkg search` gives an error "No packages match [$pkgs]", whereas `pkg search` doesn't give an error. I didn't come across this because it's not stated in the man pages for pkg info, and because I tested it with a bare install but at least one pkg, while @NYOB used it on a bare install. The fix which I've tested and seems to work nicely, is to test using `pkg info -e` whether the pkg info call will hit a "no packages exist" issue or not. If `pkg info -e` returns 0 then it's safe as there's at least one matching pkg (any other errors are allowed to occur and be detected as usual). If it returns anything else, then there's no matching pkgs, so the main `pkg info` is skipped leaving $out and other variables at the correct values they need anyway, showing a null match/none found. For details of the underlying issue being fixed, and the issue that this resubmit fixes, see the original PR. (cherry picked from commit 587988f6df7e1d3b1a369b93a5634620129e3d9d)
Diffstat (limited to 'src/usr')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud