summaryrefslogtreecommitdiffstats
path: root/pts-core
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-12-16 12:59:18 -0500
committerMichael Larabel <michael@phx-laptop.(none)>2008-12-16 12:59:18 -0500
commit0944661c4f454f1a0ef583a0a85e1691f0cefcd5 (patch)
treed8252f8450b1f108d47f12d5561d5c382690f40a /pts-core
parent2ac7b590de480801d011893be239cb2a46d2cf7b (diff)
downloadphoronix-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')
-rw-r--r--pts-core/functions/pts-functions-install_dependencies.php17
-rw-r--r--pts-core/functions/pts-functions_system_software.php31
-rw-r--r--pts-core/static/software-vendor-aliases.txt1
3 files changed, 32 insertions, 17 deletions
diff --git a/pts-core/functions/pts-functions-install_dependencies.php b/pts-core/functions/pts-functions-install_dependencies.php
index f7ead7a..b01486b 100644
--- a/pts-core/functions/pts-functions-install_dependencies.php
+++ b/pts-core/functions/pts-functions-install_dependencies.php
@@ -21,23 +21,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-function pts_package_vendor_identifier()
-{
- $vendor = pts_vendor_identifier();
-
- if(!is_file(XML_DISTRO_DIR . $vendor . "-packages.xml") && !is_file(SCRIPT_DISTRO_DIR . "install-" . $vendor . "-packages.sh"))
- {
- // TODO: Move this out to an XML file instead of hard-coding the "links"
- switch($vendor)
- {
- case "suselinux":
- $vendor = "opensuse";
- break;
- }
- }
-
- return $vendor;
-}
function pts_install_package_on_distribution($identifiers)
{
// PTS External Dependencies install on distribution
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
diff --git a/pts-core/static/software-vendor-aliases.txt b/pts-core/static/software-vendor-aliases.txt
new file mode 100644
index 0000000..0e7ca6a
--- /dev/null
+++ b/pts-core/static/software-vendor-aliases.txt
@@ -0,0 +1 @@
+suselinux = opensuse