summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-07-05 13:05:23 -0300
committerRenato Botelho <renato@netgate.com>2017-07-05 13:22:22 -0300
commitea8abb80b3f799b67e6695f808bbaa48f939564d (patch)
tree7008b91e5caf8251dac08fc39072c82ef952b37f
parente927083e89798f9d2c8977eee8c7bfb5bc715c2e (diff)
downloadpfsense-ea8abb80b3f799b67e6695f808bbaa48f939564d.zip
pfsense-ea8abb80b3f799b67e6695f808bbaa48f939564d.tar.gz
Declare user_agent variable in the function it's used
-rw-r--r--src/etc/inc/pkg-utils.inc15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/etc/inc/pkg-utils.inc b/src/etc/inc/pkg-utils.inc
index 9887198..aff6389 100644
--- a/src/etc/inc/pkg-utils.inc
+++ b/src/etc/inc/pkg-utils.inc
@@ -109,6 +109,11 @@ function pkg_update($force = false) {
function pkg_env($extra_env = array()) {
global $config, $g;
+ $user_agent = $g['product_name'] . '/' . $g['product_version'];
+ if (!isset($config['system']['do_not_send_host_uuid'])) {
+ $user_agent .= ' : ' . get_single_sysctl('kern.hostuuid');
+ }
+
$pkg_env_vars = array(
"LANG" => "C",
"HTTP_USER_AGENT" => $user_agent,
@@ -146,11 +151,6 @@ function pkg_call($params, $mute = false, $extra_env = array()) {
return false;
}
- $user_agent = $g['product_name'] . '/' . $g['product_version'];
- if (!isset($config['system']['do_not_send_host_uuid'])) {
- $user_agent .= ' : ' . get_single_sysctl('kern.hostuuid');
- }
-
$descriptorspec = array(
1 => array("pipe", "w"), /* stdout */
2 => array("pipe", "w") /* stderr */
@@ -231,11 +231,6 @@ function pkg_exec($params, &$stdout, &$stderr, $extra_env = array()) {
return -1;
}
- $user_agent = $g['product_name'] . '/' . $g['product_version'];
- if (!isset($config['system']['do_not_send_host_uuid'])) {
- $user_agent .= ' : ' . get_single_sysctl('kern.hostuuid');
- }
-
$descriptorspec = array(
1 => array("pipe", "w"), /* stdout */
2 => array("pipe", "w") /* stderr */
OpenPOWER on IntegriCloud