From 97899b25d1263b62f65032c65bf7c6e16d36ceed Mon Sep 17 00:00:00 2001 From: Nick Hastings Date: Sun, 7 Jul 2024 09:20:29 -0400 Subject: [PATCH] Revert "Merge pull request #170 from alliedmodders/psy/abso-path-scripts-fix" This reverts commit f1e06fb4da7f1cd7ee42e30d647f83d01848e9a1, reversing changes made to 88895abcf3c1b4f647367aba1a0c6cf1686c339c. --- ambuild2/frontend/v2_2/context_manager.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/ambuild2/frontend/v2_2/context_manager.py b/ambuild2/frontend/v2_2/context_manager.py index 76394fe..5c895e7 100644 --- a/ambuild2/frontend/v2_2/context_manager.py +++ b/ambuild2/frontend/v2_2/context_manager.py @@ -70,13 +70,10 @@ def runBuildScript(self, context, path, vars = None): def importScriptImpl(self, parent, path, vars): assert isinstance(path, util.StringType()) - sourceFolder, _ = self.computeScriptPaths(parent, path) + sourceFolder, _, scriptFile = self.computeScriptPaths(parent, path) # Get the absolute script path. - if os.path.isabs(path): - scriptPath = path - else: - scriptPath = os.path.join(self.sourcePath, path) + scriptPath = os.path.join(self.sourcePath, scriptFile) self.generator.addConfigureFile(parent, scriptPath) # Make the new context. @@ -96,13 +93,10 @@ def runBuildScriptImpl(self, parent, path, vars): if parent is not self.contextStack_[-1]: raise Exception('Can only create child build contexts of the currently active context') - sourceFolder, buildFolder = self.computeScriptPaths(parent, path) + sourceFolder, buildFolder, scriptFile = self.computeScriptPaths(parent, path) # Get the absolute script path. - if os.path.isabs(path): - scriptPath = path - else: - scriptPath = os.path.join(self.sourcePath, path) + scriptPath = os.path.join(self.sourcePath, scriptFile) self.generator.addConfigureFile(parent, scriptPath) # Make the new context. We allow top-level contexts in the root build @@ -182,7 +176,7 @@ def computeScriptPaths(self, parent, target): sourceFolder = '' buildFolder = '' - return sourceFolder, buildFolder + return sourceFolder, buildFolder, os.path.join(sourceFolder, name) def getLocalFolder(self, context): return context.buildFolder