Parcourir la source

[1246] only check B10_FROM_SOURCE env var once

Jelte Jansen il y a 13 ans
Parent
commit
78252609c3
1 fichiers modifiés avec 5 ajouts et 3 suppressions
  1. 5 3
      src/bin/bind10/bind10_src.py.in

+ 5 - 3
src/bin/bind10/bind10_src.py.in

@@ -44,10 +44,12 @@ import os
 # installed on the system
 if "B10_FROM_SOURCE" in os.environ:
     SPECFILE_LOCATION = os.environ["B10_FROM_SOURCE"] + "/src/bin/bind10/bob.spec"
+    ADD_LIBEXEC_AND_LD_PATH = False
 else:
     PREFIX = "@prefix@"
     DATAROOTDIR = "@datarootdir@"
     SPECFILE_LOCATION = "@datadir@/@PACKAGE@/bob.spec".replace("${datarootdir}", DATAROOTDIR).replace("${prefix}", PREFIX)
+    ADD_LIBEXEC_AND_LD_PATH = True
     
 import subprocess
 import signal
@@ -187,7 +189,7 @@ class ProcessInfo:
         # on construction (self.env).
         spawn_env = copy.deepcopy(os.environ)
         spawn_env.update(self.env)
-        if 'B10_FROM_SOURCE' not in os.environ:
+        if ADD_LIBEXEC_AND_LD_PATH:
             spawn_env['PATH'] = "@@LIBEXECDIR@@:" + spawn_env['PATH']
         self.process = subprocess.Popen(self.args,
                                         stdin=subprocess.PIPE,
@@ -357,7 +359,7 @@ class BoB:
     def start_creator(self):
         self.curproc = 'b10-sockcreator'
         creator_path = os.environ['PATH']
-        if 'B10_FROM_SOURCE' not in os.environ:
+        if ADD_LIBEXEC_AND_LD_PATH:
             creator_path = "@@LIBEXECDIR@@:" + creator_path
         self.sockcreator = isc.bind10.sockcreator.Creator(creator_path)
 
@@ -590,7 +592,7 @@ class BoB:
         # a cleaner solution, but for a short term workaround we specify the
         # path here, unconditionally, and without even bothering which
         # environment variable should be used.
-        if not "B10_FROM_SOURCE" in os.environ:
+        if ADD_LIBEXEC_AND_LD_PATH:
             cur_path = os.getenv('DYLD_LIBRARY_PATH')
             cur_path = '' if cur_path is None else ':' + cur_path
             c_channel_env['DYLD_LIBRARY_PATH'] = "@@LIBDIR@@" + cur_path