Browse Source

Use absolute paths for TROOT and IROOT

Hamilton Turner 11 years ago
parent
commit
bfd618e769
2 changed files with 19 additions and 23 deletions
  1. 3 3
      toolset/benchmark/framework_test.py
  2. 16 20
      toolset/setup/linux/installer.py

+ 3 - 3
toolset/benchmark/framework_test.py

@@ -447,10 +447,10 @@ class FrameworkTest:
       profile="$FWROOT/config/benchmark_profile"
 
     # Setup variables for TROOT and IROOT
-    self.troot = "%s/%s" % (self.fwroot, self.directory)
+    self.troot = self.directory
     self.iroot = self.install_root
     setup_util.replace_environ(config=profile, 
-              command='export TROOT=$FWROOT/%s && export IROOT=%s' %
+              command='export TROOT=%s && export IROOT=%s' %
               (self.directory, self.install_root))
 
     # Run the module start (inside parent of TROOT)
@@ -479,7 +479,7 @@ class FrameworkTest:
       profile="$FWROOT/config/benchmark_profile"
     
     setup_util.replace_environ(config=profile, 
-              command='export TROOT=$FWROOT/%s && export IROOT=%s' %
+              command='export TROOT=%s && export IROOT=%s' %
               (self.directory, self.install_root))
 
     # Run the module stop (inside parent of TROOT)

+ 16 - 20
toolset/setup/linux/installer.py

@@ -47,11 +47,12 @@ class Installer:
 
     # Locate all installation files
     install_files = glob.glob("%s/*/install.sh" % self.fwroot)
+    install_files.extend(glob.glob("%s/frameworks/*/*/install.sh" % self.fwroot))
 
     # Run install for selected tests
     for test_install_file in install_files:
-      test_dir = os.path.basename(os.path.dirname(test_install_file))
-      test_rel_dir = os.path.relpath(os.path.dirname(test_install_file), self.fwroot)
+      test_dir = os.path.dirname(test_install_file)
+      test_rel_dir = os.path.relpath(test_dir, self.fwroot)
 
       if test_dir not in dirs:
         continue
@@ -59,11 +60,10 @@ class Installer:
       logging.info("Running installation for directory %s", test_dir)
 
       # Find installation directory 
-      # e.g. FWROOT/installs or FWROOT/installs/pertest/<test-name>
+      #   e.g. FWROOT/installs or FWROOT/installs/pertest/<test-name>
       test_install_dir="%s/%s" % (self.fwroot, self.install_dir)
       if self.strategy is 'pertest':
         test_install_dir="%s/pertest/%s" % (test_install_dir, test_dir)
-      test_rel_install_dir=os.path.relpath(test_install_dir, self.fwroot)
       if not os.path.exists(test_install_dir):
         os.makedirs(test_install_dir)
       
@@ -79,24 +79,20 @@ class Installer:
       else:
         logging.info("Loading environment from %s", profile)
       setup_util.replace_environ(config=profile, 
-        command='export TROOT=$FWROOT%s && export IROOT=$FWROOT%s' %
-        (test_rel_dir, test_rel_install_dir))
+        command='export TROOT=%s && export IROOT=%s' %
+        (test_dir, test_install_dir))
 
-      # Find relative installation file
-      test_rel_install_file = "$FWROOT%s" % setup_util.path_relative_to_root(test_install_file)
-
-      # Then run test installer file
-      # Give all installers a number of variables
-      # FWROOT - Path of the FwBm root
-      # IROOT  - Path of this test's install directory
-      # TROOT  - Path to this test's directory 
+      # Run test installation script
+      #   FWROOT - Path of the FwBm root
+      #   IROOT  - Path of this test's install directory
+      #   TROOT  - Path to this test's directory 
       self.__run_command('''
-        export TROOT=$FWROOT/%s && 
-        export IROOT=$FWROOT/%s && 
-        . %s && 
-        . %s''' % 
-        (test_rel_dir, test_rel_install_dir, 
-          bash_functions_path, test_rel_install_file),
+        export TROOT=%s && 
+        export IROOT=%s && 
+        source %s && 
+        source %s''' % 
+        (test_dir, test_install_dir, 
+          bash_functions_path, test_install_file),
           cwd=test_install_dir)
 
       # Move back to previous directory