diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-16 12:43:31 -0500 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-16 12:43:31 -0500 |
commit | 2ac7b590de480801d011893be239cb2a46d2cf7b (patch) | |
tree | a1f336a9bf3702a3579a99645fd2d0830ad827ab /pts-core | |
parent | 2e65795a37b1b59487dc0fe1ad054f8ff9e2edd8 (diff) | |
download | phoronix-test-suite-upstream-2ac7b590de480801d011893be239cb2a46d2cf7b.tar.gz phoronix-test-suite-upstream-2ac7b590de480801d011893be239cb2a46d2cf7b.tar.xz phoronix-test-suite-upstream-2ac7b590de480801d011893be239cb2a46d2cf7b.zip |
pts-core: Check all supplied arguments for a PCQS test when determining
if PCQS needs to be installed
Diffstat (limited to 'pts-core')
-rw-r--r-- | pts-core/options/install_test.php | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/pts-core/options/install_test.php b/pts-core/options/install_test.php index 726563a..0a23c72 100644 --- a/pts-core/options/install_test.php +++ b/pts-core/options/install_test.php @@ -44,31 +44,34 @@ class install_test implements pts_option_interface pts_set_assignment("PTS_FORCE_INSTALL", 1); } - // TODO: Search $items_to_install and look for pcqs match instead of only first argument - if(strpos($items_to_install[0], "pcqs") !== false && !is_file(XML_SUITE_LOCAL_DIR . "pcqs-license.txt")) + foreach($items_to_install as $this_install) { - // Install the Phoronix Certification & Qualification Suite - $agreement = wordwrap(file_get_contents("http://www.phoronix-test-suite.com/pcqs/pcqs-license.txt"), 65); - - if(strpos($agreement, "PCQS") == false) - { - echo pts_string_header("An error occurred while connecting to the Phoronix Test Suite server. Try again later."); - return false; - } - - echo "\n\n" . $agreement; - $agree = pts_bool_question("Do you agree to these terms in full and wish to proceed (y/n)?", false); - - if($agree) - { - pts_download("http://www.phoronix-test-suite.com/pcqs/download-pcqs.php", XML_SUITE_LOCAL_DIR . "pcqs-suite.tar"); - pts_extract_file(XML_SUITE_LOCAL_DIR . "pcqs-suite.tar", true); - echo pts_string_header("The Phoronix Certification & Qualification Suite is now installed."); - } - else + if(strpos($this_install, "pcqs-") !== false && !is_file(XML_SUITE_LOCAL_DIR . "pcqs-license.txt")) { - pts_string_header("In order to run PCQS you must agree to the listed terms."); - return false; + // Install the Phoronix Certification & Qualification Suite + $agreement = wordwrap(file_get_contents("http://www.phoronix-test-suite.com/pcqs/pcqs-license.txt"), 65); + + if(strpos($agreement, "PCQS") == false) + { + echo pts_string_header("An error occurred while connecting to the Phoronix Test Suite server. Try again later."); + return false; + } + + echo "\n\n" . $agreement; + $agree = pts_bool_question("Do you agree to these terms in full and wish to proceed (y/n)?", false); + + if($agree) + { + pts_download("http://www.phoronix-test-suite.com/pcqs/download-pcqs.php", XML_SUITE_LOCAL_DIR . "pcqs-suite.tar"); + pts_extract_file(XML_SUITE_LOCAL_DIR . "pcqs-suite.tar", true); + echo pts_string_header("The Phoronix Certification & Qualification Suite is now installed."); + break; + } + else + { + pts_string_header("In order to run PCQS you must agree to the listed terms."); + return false; + } } } |