Skip to content

Commit

Permalink
Revert "Merge pull request #170 from alliedmodders/psy/abso-path-scri…
Browse files Browse the repository at this point in the history
…pts-fix"

This reverts commit f1e06fb, reversing
changes made to 88895ab.
  • Loading branch information
psychonic committed Jul 7, 2024
1 parent f1e06fb commit 97899b2
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions ambuild2/frontend/v2_2/context_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 97899b2

Please sign in to comment.