svn commit: r221162 - projects/portbuild/qmanager
Florent Thoumie
flz at FreeBSD.org
Thu Apr 28 12:39:31 UTC 2011
Author: flz
Date: Thu Apr 28 12:39:31 2011
New Revision: 221162
URL: http://svn.freebsd.org/changeset/base/221162
Log:
portbuild: don't hardcode qmanager socket in qclient.
Use freebsd_config module to get QMANAGER_SOCKET_FILE.
Modified:
projects/portbuild/qmanager/qclient
Modified: projects/portbuild/qmanager/qclient
==============================================================================
--- projects/portbuild/qmanager/qclient Thu Apr 28 11:21:49 2011 (r221161)
+++ projects/portbuild/qmanager/qclient Thu Apr 28 12:39:31 2011 (r221162)
@@ -8,7 +8,22 @@
import socket, os, sys
from optparse import OptionParser
+
+pbc = os.getenv('PORTBUILD_CHECKOUT') \
+ if os.getenv('PORTBUILD_CHECKOUT') else "/var/portbuild"
+pbd = os.getenv('PORTBUILD_DATA') \
+ if os.getenv('PORTBUILD_DATA') else "/var/portbuild"
+
+sys.path.insert(0, '%s/lib/python' % pbc)
+
from qmanagerclient import *
+from freebsd_config import *
+
+CONFIG_SUBDIR="conf"
+CONFIG_FILENAME="server.conf"
+
+config = getConfig( pbc, CONFIG_SUBDIR, CONFIG_FILENAME )
+QMANAGER_SOCKET_FILE = config.get( 'QMANAGER_SOCKET_FILE' )
def error(msg):
print >>sys.stderr, "%s: %s" % (sys.argv[0], msg.rstrip())
@@ -88,10 +103,8 @@ def buildquery(option, opt, values, pars
query.append("%s %s %s" % (key, operator, val))
-SOCKLOCAL = '/tmp/.qmgr'
-
conn = QManagerClientConn(stderr = sys.stderr)
-conn.connect(SOCKLOCAL)
+conn.connect(QMANAGER_SOCKET_FILE)
query=[]
More information about the svn-src-projects
mailing list