Summary
Description: Unnamed repository; edit this file to name it for gitweb.
Last Change: Wed 2/3/10 13:04
Recent Commits
>
--git a/CHANGE-LOG b/CHANGE-LOG
index e4add2b..65ba9a1 100644
--- a/CHANGE-LOG
+++ b/CHANGE-LOG
@@ -17,6 +17,7 @@ Phoronix Test Suite (git)
- Compatibility checks when merging results
- Improved video card detection (use GL renderer and use lspci now only for fallback)
- Add Super PI profile (Thanks to Pekka Panula)
+- Improved distribution detection
- Other small fixes
Phoronix Test Suite 0.1.0
diff --git a/pts-core/functions/pts-functions_linux.php b/pts-core/functions/pts-functions_linux.php
index 3629c55..17ecbf1 100644
--- a/pts-core/functions/pts-functions_linux.php
+++ b/pts-core/functions/pts-functions_linux.php
@@ -110,30 +110,28 @@ function current_screen_height()
}
function parse_lsb_output($desc)
{
- if(is_file("/etc/lsb-release"))
- {
- $info = file_get_contents("/etc/lsb-release");
- if(($pos = strpos($info, $desc)) === FALSE)
- $info = "Unknown";
- else
- {
- $info = substr($info, $pos + strlen($desc));
- $info = str_replace(array("\"", " " ), "", trim(substr($info, 0, strpos($info, "\n"))));
- }
+ $info = shell_exec("lsb_release -a 2>&1");
+
+ if(($pos = strrpos($info, $desc . ':')) === FALSE)
+ {
+ $info = "Unknown";
}
else
- $info = "Unknown";
+ {
+ $info = substr($info, $pos + strlen($desc) + 1);
+ $info = trim(substr($info, 0, strpos($info, "\n")));
+ }
return $info;
}
function os_vendor()
{
- return parse_lsb_output("DISTRIB_ID=");
+ return parse_lsb_output("Distributor ID");
}
function os_version()
{
- return parse_lsb_output("DISTRIB_RELEASE=");
+ return parse_lsb_output("Release");
}
function kernel_string()
{
@@ -145,7 +143,7 @@ function kernel_arch()
}
function graphics_processor_string()
{
- $info = shell_exec("glxinfo | grep renderer");
+ $info = shell_exec("glxinfo | grep renderer 2>&1");
if(($pos = strpos($info, "renderer string:")) > 0)
{
<
Copyright © 2010 by Phoronix Media