]> rtime.felk.cvut.cz Git - linux-conf-perf.git/commitdiff
Fix relative path to .target file
authorKarel Kočí <cynerd@email.cz>
Mon, 17 Aug 2015 14:25:11 +0000 (16:25 +0200)
committerKarel Kočí <cynerd@email.cz>
Mon, 17 Aug 2015 14:25:11 +0000 (16:25 +0200)
.target file should load always from root folder of project to ensure,
that all tools in project are targeting same target.

conf.py

diff --git a/conf.py b/conf.py
index c2f1902b52cf42b5689384254497d9d28021b6ec..b4b817917dd83d4e3f12697efb4e9e685b37f1e8 100644 (file)
--- a/conf.py
+++ b/conf.py
@@ -126,13 +126,16 @@ write_config = 'scripts/write_config/write_config'
 picosat = 'scripts/picosat-959/picosat'
 allconfig = 'scripts/allconfig/allconfig'
 
+#######################################
+absroot = os.path.dirname(os.path.realpath(__file__))
+
 #######################################
 # Overlap configuration for specified target
-if os.path.isfile('.target'):
+if os.path.isfile(os.path.join(absroot, '.target')):
        target = None
-       with open('.target', 'r') as f:
+       with open(os.path.join(absroot, '.target'), 'r') as f:
                target = f.readline().rstrip()
-       conffile = os.path.join('targets', target, 'conf.py')
+       conffile = os.path.join(absroot, 'targets', target, 'conf.py')
        if os.path.isfile(conffile):
                ovconf = importlib.machinery.SourceFileLoader("module.name", conffile).load_module()
                for name in dir(ovconf):
@@ -142,6 +145,3 @@ if os.path.isfile('.target'):
                print("W: No target specifier. Write target to .target file.")
 else:
        print("W: No target specifier. Write target to .target file.")
-
-#######################################
-absroot = os.path.dirname(os.path.realpath(__file__))