summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorMark Linimon <linimon@FreeBSD.org>2010-06-25 23:02:09 +0000
committerMark Linimon <linimon@FreeBSD.org>2010-06-25 23:02:09 +0000
commit381f8cb94bce74a2b205297c67f13bf72e7feaff (patch)
tree83b51a2b0f2a116bf2aeda6ed15c317c10dd248f /Tools
parentGeneralize the packge building scripts to be able to be run on more than (diff)
Generalize the packge building scripts to be able to be run on more than
one 'head' node, rather than just pointyhat itself. Constants are factored out into installation-specific files known as portbuild/conf/server.conf and portbuild/conf/client.conf. There is only one server.conf file. Individual <arch> directories may have their own client.conf files, or may symlink to ../conf/client.conf. While here, do some cleanup. Feature safe: yes
Notes
Notes: svn path=/head/; revision=256979
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/buildproxy19
-rwxr-xr-xTools/portbuild/scripts/buildproxy-client13
2 files changed, 22 insertions, 10 deletions
diff --git a/Tools/portbuild/scripts/buildproxy b/Tools/portbuild/scripts/buildproxy
index 75e085eb5cc3..aed7d60c4eb1 100755
--- a/Tools/portbuild/scripts/buildproxy
+++ b/Tools/portbuild/scripts/buildproxy
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# $FreeBSD$
#
# Allow access to privileged build commands to ports-* users for
# managing their own build spaces.
@@ -6,8 +7,11 @@
import sys, socket, os, commands
from freebsd import *
+from freebsd_config import *
-SOCKET='/tmp/.build'
+CONFIG_DIR="/var/portbuild"
+CONFIG_SUBDIR="conf"
+CONFIG_FILENAME="server.conf"
valid_cmds = ['create', 'clone', 'portsupdate', 'srcupdate', 'destroy']
@@ -46,12 +50,15 @@ def process(cmd, sockfile):
return (status, out)
-if os.path.exists(SOCKET):
- os.unlink(SOCKET)
+config = getConfig( CONFIG_DIR, CONFIG_SUBDIR, CONFIG_FILENAME )
+BUILDPROXY_SOCKET_FILE = config.get( 'BUILDPROXY_SOCKET_FILE' )
+
+if os.path.exists(BUILDPROXY_SOCKET_FILE):
+ os.unlink(BUILDPROXY_SOCKET_FILE)
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
-s.bind(SOCKET)
-os.chmod(SOCKET, 0660)
-os.chown(SOCKET, -1, getgidbyname('portmgr'))
+s.bind(BUILDPROXY_SOCKET_FILE)
+os.chmod(BUILDPROXY_SOCKET_FILE, 0660)
+os.chown(BUILDPROXY_SOCKET_FILE, -1, getgidbyname('portmgr'))
s.listen(10)
diff --git a/Tools/portbuild/scripts/buildproxy-client b/Tools/portbuild/scripts/buildproxy-client
index f8de6fe878e0..d8a08965b6d2 100755
--- a/Tools/portbuild/scripts/buildproxy-client
+++ b/Tools/portbuild/scripts/buildproxy-client
@@ -1,16 +1,23 @@
#!/usr/bin/env python
+# $FreeBSD$
#
# Client for communicating proxy requests to the buildproxy
import sys, socket, os, commands
from freebsd import *
+from freebsd_config import *
-SOCKET='/tmp/.build'
+CONFIG_DIR="/var/portbuild"
+CONFIG_SUBDIR="conf"
+CONFIG_FILENAME="server.conf"
+
+config = getConfig( CONFIG_DIR, CONFIG_SUBDIR, CONFIG_FILENAME )
+BUILDPROXY_SOCKET_FILE = config.get( 'BUILDPROXY_SOCKET_FILE' )
try:
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- s.connect(SOCKET)
+ s.connect(BUILDPROXY_SOCKET_FILE)
sockfile = s.makefile()
sockfile.write("%s\n" % " ".join(sys.argv[1:]))
@@ -38,5 +45,3 @@ except Exception, e:
print e2
raise e # XXX debug
sys.exit(254)
-
-