Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Unified Diff: pydir/utils.py

Issue 525603002: Subzero: Remove the need for a separate NaCl SDK. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix up some path issues Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pydir/build-pnacl-ir.py ('k') | tests_lit/lit.cfg » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pydir/utils.py
diff --git a/pydir/utils.py b/pydir/utils.py
index 57849a4c7c0776eee7f93eba55fbc4a745f0ff78..33b58e9104baa0c0227fe37869dadcff0aa71937 100644
--- a/pydir/utils.py
+++ b/pydir/utils.py
@@ -1,3 +1,4 @@
+import os
import subprocess
import sys
@@ -10,3 +11,12 @@ def shellcmd(command, echo=True):
stdout_result = subprocess.check_output(command, shell=True)
if echo: sys.stdout.write(stdout_result)
return stdout_result
+
+def FindBaseNaCl():
+ """Find the base native_client/ directory."""
+ nacl = 'native_client'
+ path_list = os.getcwd().split(os.sep)
+ if nacl not in path_list:
+ return None
+ last_index = len(path_list) - path_list[::-1].index(nacl)
+ return os.sep.join(path_list[:last_index])
« no previous file with comments | « pydir/build-pnacl-ir.py ('k') | tests_lit/lit.cfg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698