Browse Source

If B10_FROM_SOURCE is set in the environment, we use PEM file
from a directory relative to that, otherwise we use the one
installed on the system.


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1450 e5f2f494-b856-4b98-b285-d166d9295462

Jeremy C. Reed 15 years ago
parent
commit
82032d939a
2 changed files with 11 additions and 1 deletions
  1. 8 1
      src/bin/bindctl/bindctl-source.py.in
  2. 3 0
      src/bin/bindctl/run_bindctl.sh.in

+ 8 - 1
src/bin/bindctl/bindctl-source.py.in

@@ -111,7 +111,14 @@ if __name__ == '__main__':
         set_bindctl_options(parser)
         (options, args) = parser.parse_args()
         server_addr = options.addr + ':' + str(options.port)
-        tool = BindCmdInterpreter(server_addr, pem_file = "@@SYSCONFDIR@@/bind10/bindctl.pem")
+        # If B10_FROM_SOURCE is set in the environment, we use PEM file
+        # from a directory relative to that, otherwise we use the one
+        # installed on the system
+        if "B10_FROM_SOURCE" in os.environ:
+            SYSCONF_PATH = os.environ["B10_FROM_SOURCE"] + "/src/bin/bindctl"
+        else:
+            SYSCONF_PATH = "@@SYSCONFDIR@@/@PACKAGE@"
+        tool = BindCmdInterpreter(server_addr, pem_file = SYSCONF_PATH + "/bindctl.pem")
         prepare_config_commands(tool)
         tool.run()
     except Exception as e:

+ 3 - 0
src/bin/bindctl/run_bindctl.sh.in

@@ -8,5 +8,8 @@ BINDCTL_PATH=@abs_top_srcdir@/src/bin/bindctl
 PYTHONPATH=@abs_top_builddir@/src/lib/python:@abs_top_builddir@/src/bin
 export PYTHONPATH
 
+B10_FROM_SOURCE=@abs_top_srcdir@
+export B10_FROM_SOURCE
+
 cd ${BINDCTL_PATH}
 exec ${PYTHON_EXEC} -O bindctl $*