summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-01-20 10:53:09 -0200
committerRenato Botelho <garga@FreeBSD.org>2014-01-20 10:53:09 -0200
commit770a7759f04fccff5fdc0d1e6b2f996d1e90ada2 (patch)
tree2337fc65ae9c834a0483a00782e4e07e34642d78 /etc
parentc42d721bb9de6940aafd73a7abc54f3a0ffbbd11 (diff)
downloadpfsense-770a7759f04fccff5fdc0d1e6b2f996d1e90ada2.zip
pfsense-770a7759f04fccff5fdc0d1e6b2f996d1e90ada2.tar.gz
Fix FreeBSD version detection for 10.x
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pfsense-utils.inc3
-rw-r--r--etc/inc/pkg-utils.inc6
2 files changed, 3 insertions, 6 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 52ca57b..1c4936c 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1628,8 +1628,7 @@ function isvm() {
}
function get_freebsd_version() {
- $version = php_uname("r");
- return $version[0];
+ return preg_replace('/\..*$/', '', php_uname("r"));
}
function download_file($url, $destination, $verify_ssl = false, $connect_timeout = 60, $timeout = 0) {
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index e1195bc..1a6beaf 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -198,12 +198,11 @@ function get_pkg_internal_name($package) {
function get_pkg_info($pkgs = 'all', $info = 'all') {
global $g;
- $freebsd_version = php_uname("r");
$freebsd_machine = php_uname("m");
$params = array(
"pkg" => $pkgs,
"info" => $info,
- "freebsd_version" => $freebsd_version[0],
+ "freebsd_version" => get_freebsd_version(),
"freebsd_machine" => $freebsd_machine
);
$resp = call_pfsense_method('pfsense.get_pkgs', $params, 10);
@@ -213,11 +212,10 @@ function get_pkg_info($pkgs = 'all', $info = 'all') {
function get_pkg_sizes($pkgs = 'all') {
global $config, $g;
- $freebsd_version = php_uname("r");
$freebsd_machine = php_uname("m");
$params = array(
"pkg" => $pkgs,
- "freebsd_version" => $freebsd_version,
+ "freebsd_version" => get_freebsd_version(),
"freebsd_machine" => $freebsd_machine
);
$msg = new XML_RPC_Message('pfsense.get_pkg_sizes', array(php_value_to_xmlrpc($params)));
OpenPOWER on IntegriCloud