gooftool: Fix script execution path.
gooftool moved its location so script path should also be fixed.
BUG=none
TEST=gooftool verify_keys
Change-Id: I7444c9296acdabcc1f57ec63a0e71ef17d8931a6
Reviewed-on: https://gerrit.chromium.org/gerrit/28782
Reviewed-by: Ricky Liang <jcliang@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
diff --git a/py/gooftool/gooftool.py b/py/gooftool/gooftool.py
index 9d5a61b..7c951ad 100755
--- a/py/gooftool/gooftool.py
+++ b/py/gooftool/gooftool.py
@@ -80,8 +80,11 @@
def FindScript(script_name):
- script_path = os.path.join(os.path.dirname(os.path.dirname(
- os.path.realpath(__file__))), 'sh', script_name)
+ # __file__ is in /usr/local/factory/py/gooftool/gooftool.py
+ # scripts should be in /usr/local/factory/sh/*
+ factory_base = os.path.realpath(os.path.join(
+ os.path.dirname(os.path.realpath(__file__)), '..', '..'))
+ script_path = os.path.join(factory_base, 'sh', script_name)
if not os.path.exists(script_path):
raise Error('Needed script %s does not exist.' % script_path)
return script_path