diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-16 12:59:18 -0500 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-16 12:59:18 -0500 |
commit | 0944661c4f454f1a0ef583a0a85e1691f0cefcd5 (patch) | |
tree | d8252f8450b1f108d47f12d5561d5c382690f40a /pts-core/functions/pts-functions_system_software.php | |
parent | 2ac7b590de480801d011893be239cb2a46d2cf7b (diff) | |
download | phoronix-test-suite-upstream-0944661c4f454f1a0ef583a0a85e1691f0cefcd5.tar.gz phoronix-test-suite-upstream-0944661c4f454f1a0ef583a0a85e1691f0cefcd5.tar.xz phoronix-test-suite-upstream-0944661c4f454f1a0ef583a0a85e1691f0cefcd5.zip |
pts-core: Store aliases for distributions used in package identification
in pts-core/static/software-vendor-aliases.txt
Diffstat (limited to 'pts-core/functions/pts-functions_system_software.php')
-rw-r--r-- | pts-core/functions/pts-functions_system_software.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/pts-core/functions/pts-functions_system_software.php b/pts-core/functions/pts-functions_system_software.php index 757ea63..454170a 100644 --- a/pts-core/functions/pts-functions_system_software.php +++ b/pts-core/functions/pts-functions_system_software.php @@ -38,6 +38,37 @@ function pts_vendor_identifier() return strtolower($vendor); } +function pts_package_vendor_identifier() +{ + $os_vendor = pts_vendor_identifier(); + + if(!is_file(XML_DISTRO_DIR . $os_vendor . "-packages.xml") && !is_file(SCRIPT_DISTRO_DIR . "install-" . $os_vendor . "-packages.sh")) + { + if(is_file(STATIC_DIR . "software-vendor-aliases.txt")) + { + $vendors_alias_file = trim(file_get_contents(STATIC_DIR . "software-vendor-aliases.txt")); + $vendors_r = explode("\n", $vendors_alias_file); + + foreach($vendors_r as $vendor) + { + $vendor_r = explode("=", $vendor); + + if(count($vendor_r) == 2) + { + $to_replace = trim($vendor_r[0]); + + if($os_vendor == $to_replace) + { + $os_vendor = trim($vendor_r[1]); + break; + } + } + } + } + } + + return $vendor; +} function sw_os_virtualized_mode() { // Reports if system is running virtualized |