Results 1 to 6 of 6

Thread: Patch to add "install-all"

  1. #1
    Join Date
    Apr 2008
    Location
    York, UK
    Posts
    134

    Default Patch to add "install-all"

    Adds ability to install/update all current test profiles in one go. At the moment there's no force-install-all.

    Code:
    diff --git a/phoronix-test-suite b/phoronix-test-suite
    index 9040704..ccaaf93 100755
    --- a/phoronix-test-suite
    +++ b/phoronix-test-suite
    @@ -68,6 +68,9 @@ case "$1" in
     "install-dependencies")
            $PHP_BIN pts-core/pts-run-cmd.php INSTALL_EXTERNAL_DEPENDENCIES $2
            ;;
    +"install-all")
    +       $PHP_BIN pts-core/pts-run-cmd.php INSTALL_ALL
    +       ;;
     "run")
            $PHP_BIN pts-core/pts-run-benchmark.php $2
            ;;
    @@ -152,6 +155,7 @@ http://www.phoronix-test-suite.com/
    
     install <suite OR test>: Install or Update The Specified Test(s)
     install-dependencies <suite OR test>: Install The External (Distribution) Dependencies For Specified Test(s)
    +install-all: Install or Update all available tests
     run <suite OR test>: Run The Specified Test/Suite
     batch-run <suite OR test>: Run The Specified Test/Suite in Batch Mode
     benchmark <suite OR test OR saved file>: Same as manually running install and then run
    diff --git a/pts-core/functions/pts-functions-install.php b/pts-core/functions/pts-functions-install.php
    index 5989a38..2520047 100644
    --- a/pts-core/functions/pts-functions-install.php
    +++ b/pts-core/functions/pts-functions-install.php
    @@ -305,6 +305,7 @@ function pts_external_dependency_generic($Name)
                    $file_check = $xml_parser->getXMLArrayValues(P_EXDEP_PACKAGE_FILECHECK);
    
                    $selection = -1;
    +               $PTS_MANUAL_SUPPORT = 0;
                    for($i = 0; $i < count($title) && $selection == -1; $i++)
                    {
                            if($Name == $package_name[$i])
    @@ -312,13 +313,15 @@ function pts_external_dependency_generic($Name)
                                    $selection = $i;
                                    if(pts_file_missing_check(explode(",", $file_check[$selection])))
                                    {
    -                                       if(!defined("PTS_MANUAL_SUPPORT"))
    -                                               define("PTS_MANUAL_SUPPORT", 1);
    +                                       if($PTS_MANUAL_SUPPORT == 0)
    +                                               $PTS_MANUAL_SUPPORT = 1;
    
                                            echo pts_string_header($title[$selection] . "\nPossible Package Names: " . $possible_packages[$selection]);
                                    }
                            }
                    }
    +               if($PTS_MANUAL_SUPPORT == 1)
    +                       pts_bool_question("The above dependencies should be installed before proceeding otherwise one or more benchmarks could fail. Press any key when you're ready to continue");
            }
    
            return $generic_information;
    diff --git a/pts-core/pts-run-cmd.php b/pts-core/pts-run-cmd.php
    index 481d767..116b2da 100644
    --- a/pts-core/pts-run-cmd.php
    +++ b/pts-core/pts-run-cmd.php
    @@ -79,15 +79,24 @@ switch($COMMAND)
                    // Any external dependencies?
                    pts_install_package_on_distribution($ARG_1);
    
    -               if(defined("PTS_MANUAL_SUPPORT"))
    -               {
    -                       pts_bool_question("These dependencies should be installed before proceeding as one or more benchmarks could fail. Press any key when you're ready to continue");
    -               }
    -
                    // Install benchmarks
                    $install_objects = "";
                    pts_recurse_install_benchmark($ARG_1, $install_objects);
                    break;
    +       case "INSTALL_ALL":
    +               require_once("pts-core/functions/pts-functions-install.php");
    +               foreach(glob(TEST_RESOURCE_DIR . "*/downloads.xml") as $downloads_file)
    +               {
    +                       $test = substr($downloads_file, strlen(TEST_RESOURCE_DIR), 0 - 14);
    +
    +                       // Any external dependencies?
    +                       pts_install_package_on_distribution($test);
    +
    +                       // Install benchmarks
    +                       $install_objects = "";
    +                       pts_recurse_install_benchmark($test, $install_objects);
    +               }
    +               break;
            case "INSTALL_EXTERNAL_DEPENDENCIES":
                    require_once("pts-core/functions/pts-functions-install.php");
    Last edited by uncle_fungus; 05-22-2008 at 12:26 PM.

  2. #2
    Join Date
    May 2007
    Location
    Third Rock from the Sun
    Posts
    6,584

    Default

    Thank you!!!

  3. #3

    Default

    Now found in git, thanks.

  4. #4
    Join Date
    Apr 2008
    Location
    York, UK
    Posts
    134

    Default

    Patch for "force-install-all":

    Code:
    diff --git a/phoronix-test-suite b/phoronix-test-suite
    index ccaaf93..02df2af 100755
    --- a/phoronix-test-suite
    +++ b/phoronix-test-suite
    @@ -68,6 +68,9 @@ case "$1" in
     "install-dependencies")
            $PHP_BIN pts-core/pts-run-cmd.php INSTALL_EXTERNAL_DEPENDENCIES $2
            ;;
    +"force-install-all")
    +       $PHP_BIN pts-core/pts-run-cmd.php FORCE_INSTALL_ALL
    +       ;;
     "install-all")
            $PHP_BIN pts-core/pts-run-cmd.php INSTALL_ALL
            ;;
    diff --git a/pts-core/pts-run-cmd.php b/pts-core/pts-run-cmd.php
    index be3ee30..8f304af 100644
    --- a/pts-core/pts-run-cmd.php
    +++ b/pts-core/pts-run-cmd.php
    @@ -83,9 +83,11 @@ switch($COMMAND)
                    $install_objects = "";
                    pts_recurse_install_benchmark($ARG_1, $install_objects);
                    break;
    +       case "FORCE_INSTALL_ALL":
            case "INSTALL_ALL":
                    require_once("pts-core/functions/pts-functions-install.php");
    -
    +               if($COMMAND == "FORCE_INSTALL_ALL")
    +                       define("PTS_FORCE_INSTALL", 1);
                    foreach(glob(TEST_RESOURCE_DIR . "*/downloads.xml") as $downloads_file)
                    {
                            $test = substr($downloads_file, strlen(TEST_RESOURCE_DIR), 0 - 14);

  5. #5

    Default

    Patched in git.

  6. #6
    Join Date
    Apr 2008
    Location
    York, UK
    Posts
    134

    Default

    Fix for small bug, walks through profiles rather than downloads.xml files.

    Code:
    diff --git a/pts-core/pts-run-cmd.php b/pts-core/pts-run-cmd.php
    index 946ad53..5d3e56c 100644
    --- a/pts-core/pts-run-cmd.php
    +++ b/pts-core/pts-run-cmd.php
    @@ -90,9 +90,9 @@ switch($COMMAND)
                    if($COMMAND == "FORCE_INSTALL_ALL")
                            define("PTS_FORCE_INSTALL", 1);
    
    -               foreach(glob(TEST_RESOURCE_DIR . "*/downloads.xml") as $downloads_file)
    +               foreach(glob(XML_PROFILE_DIR . "*.xml") as $benchmark_file)
                    {
    -                       $test = substr($downloads_file, strlen(TEST_RESOURCE_DIR), 0 - 14);
    +                       $test = basename($benchmark_file, ".xml");
    
                            // Any external dependencies?
                            pts_install_package_on_distribution($test);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •