summaryrefslogtreecommitdiffstats
path: root/src/etc/inc
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-03-03 14:49:11 -0300
committerRenato Botelho <renato@netgate.com>2016-03-03 14:49:11 -0300
commitc86db913df4c996020d73e0016e76fba49e2cfbe (patch)
treed8bd8042bc3b32aa5a2c00744d9e7ccb09549b7c /src/etc/inc
parente440add81f83f82e9c785cb333c6b6c81b02c1eb (diff)
downloadpfsense-c86db913df4c996020d73e0016e76fba49e2cfbe.zip
pfsense-c86db913df4c996020d73e0016e76fba49e2cfbe.tar.gz
Add an option to get_pkg_info() that makes it do not try to update metadata
Diffstat (limited to 'src/etc/inc')
-rw-r--r--src/etc/inc/pkg-utils.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/etc/inc/pkg-utils.inc b/src/etc/inc/pkg-utils.inc
index 338b724..3977ce8 100644
--- a/src/etc/inc/pkg-utils.inc
+++ b/src/etc/inc/pkg-utils.inc
@@ -365,7 +365,7 @@ function get_package_internal_name($package_data) {
}
// Get information about packages.
-function get_pkg_info($pkgs = 'all', $info = 'all') {
+function get_pkg_info($pkgs = 'all', $info = 'all', $only_local = false) {
global $g, $input_errors;
$out = '';
@@ -381,7 +381,12 @@ function get_pkg_info($pkgs = 'all', $info = 'all') {
$pkgs = $g['pkg_prefix'];
}
- $rc = pkg_exec("search --raw-format json-compact " . $pkgs, $out, $err);
+ $extra_param = "";
+ if ($only_local) {
+ $extra_param = "-U ";
+ }
+
+ $rc = pkg_exec("search {$extra_param}--raw-format json-compact " . $pkgs, $out, $err);
if ($rc != 0) {
update_status("\n" . gettext(
OpenPOWER on IntegriCloud