[svn] commit: r675 - in /branches/parkinglot/src/bin/cmdctl: Makefile.am b10-cmdctl.py.in

BIND 10 source code commits bind10-changes at lists.isc.org
Sat Jan 30 00:39:58 UTC 2010


Author: jelte
Date: Sat Jan 30 00:39:58 2010
New Revision: 675

Log:
use the B10_FROM_SOURCE to also find the location of passwd.csv
(and, to prepare for future specfiles, for cmdctl.spec which isn't used yet afaik)

Modified:
    branches/parkinglot/src/bin/cmdctl/Makefile.am
    branches/parkinglot/src/bin/cmdctl/b10-cmdctl.py.in

Modified: branches/parkinglot/src/bin/cmdctl/Makefile.am
==============================================================================
--- branches/parkinglot/src/bin/cmdctl/Makefile.am (original)
+++ branches/parkinglot/src/bin/cmdctl/Makefile.am Sat Jan 30 00:39:58 2010
@@ -1,6 +1,9 @@
 pkglibexecdir = $(libexecdir)/@PACKAGE@
 
 pkglibexec_SCRIPTS = b10-cmdctl
+
+b10_cmdctldir = $(DESTDIR)$(pkgdatadir)
+b10_cmdctl_DATA = passwd.csv
 
 CLEANFILES=	b10-cmdctl.py
 

Modified: branches/parkinglot/src/bin/cmdctl/b10-cmdctl.py.in
==============================================================================
--- branches/parkinglot/src/bin/cmdctl/b10-cmdctl.py.in (original)
+++ branches/parkinglot/src/bin/cmdctl/b10-cmdctl.py.in Sat Jan 30 00:39:58 2010
@@ -27,6 +27,7 @@
 '''
 
 import sys; sys.path.append ('@@PYTHONPATH@@')
+import os
 import http.server
 import urllib.parse
 import json
@@ -46,6 +47,18 @@
 URL_PATTERN = re.compile('/([\w]+)(?:/([\w]+))?/?')
 USER_INFO_FILE = "passwd.csv"
 CERTIFICATE_FILE = 'b10-cmdctl.pem'
+
+# If B10_FROM_SOURCE is set in the environment, we use data files
+# from a directory relative to that, otherwise we use the ones
+# installed on the system
+if "B10_FROM_SOURCE" in os.environ:
+    SPECFILE_PATH = os.environ["B10_FROM_SOURCE"] + "/src/bin/cmdctl"
+else:
+    PREFIX = "@prefix@"
+    DATAROOTDIR = "@datarootdir@"
+    SPECFILE_PATH = "@datadir@/@PACKAGE@".replace("${datarootdir}", DATAROOTDIR).replace("${prefix}", PREFIX)
+SPECFILE_LOCATION = SPECFILE_PATH + "/cmdctl.spec"
+USER_INFO_FILE = SPECFILE_PATH + "/passwd.csv"
         
 class SecureHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
     '''https connection request handler.




More information about the bind10-changes mailing list