diff options
author | Renato Botelho <renato@netgate.com> | 2017-07-05 13:05:23 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-07-05 13:05:23 -0300 |
commit | d49ad309f9006440cb81f5c8ff8990bf9325a92b (patch) | |
tree | e3598bb318921c57c5a2b4982d588bf8626a0272 /src | |
parent | 2f8793b72811d13a6b46244e17ae452d061e8a05 (diff) | |
download | pfsense-d49ad309f9006440cb81f5c8ff8990bf9325a92b.zip pfsense-d49ad309f9006440cb81f5c8ff8990bf9325a92b.tar.gz |
Declare user_agent variable in the function it's used
Diffstat (limited to 'src')
-rw-r--r-- | src/etc/inc/pkg-utils.inc | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/etc/inc/pkg-utils.inc b/src/etc/inc/pkg-utils.inc index a7e51f5..9d78f71 100644 --- a/src/etc/inc/pkg-utils.inc +++ b/src/etc/inc/pkg-utils.inc @@ -77,6 +77,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, @@ -117,11 +122,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 */ @@ -199,11 +199,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 */ |