svn commit: r244222 - projects/portbuild/scripts
Mark Linimon
linimon at FreeBSD.org
Fri Dec 14 16:12:17 UTC 2012
Author: linimon (doc,ports committer)
Date: Fri Dec 14 16:12:16 2012
New Revision: 244222
URL: http://svnweb.freebsd.org/changeset/base/244222
Log:
Un-hardwire ports-<arch> if PORTBUILD_USER/_GROUP are defined.
Modified:
projects/portbuild/scripts/pollmachine
Modified: projects/portbuild/scripts/pollmachine
==============================================================================
--- projects/portbuild/scripts/pollmachine Fri Dec 14 16:04:09 2012 (r244221)
+++ projects/portbuild/scripts/pollmachine Fri Dec 14 16:12:16 2012 (r244222)
@@ -39,6 +39,12 @@ pbd = os.getenv('PORTBUILD_DATA') \
sys.path.insert(0, '%s/lib/python' % pbc)
+from freebsd import *
+from freebsd_config import *
+
+CONFIG_SUBDIR="conf"
+CONFIG_FILENAME="server.conf"
+
if len(sys.argv) < 1:
print "Usage: %s <arch> [<arch> ...]" % sys.argv[0]
sys.exit(1)
@@ -65,6 +71,7 @@ for i in sys.argv[1:]:
# set of machines for each arch
machines={}
+# XXX MCL would be nice to remove this hardwiring
for i in arches:
machines[i]=set()
@@ -274,14 +281,20 @@ class MachinePoll(threading.Thread):
logging.info("%s finished polling for %s" % ( str(self), self.mach ))
def setup(self, branch, buildid, args = ""):
- cmd = "su ports-%s -c \"%s/scripts/dosetupnode %s %s %s %s %s\""\
- % (self.arch, pbc, self.arch, branch, buildid, self.mach, args)
+ uid = PORTBUILD_USER
+ if not uid:
+ uid = "ports-" + self.arch
+ cmd = "su %s -c \"%s/scripts/dosetupnode %s %s %s %s %s\""\
+ % (uid, pbc, self.arch, branch, buildid, self.mach, args)
child = subprocess.Popen(cmd, shell=True, stderr = subprocess.STDOUT,
stdout = subprocess.PIPE)
err = child.wait()
out = "".join(child.stdout.readlines())
return (err, out)
+config = getConfig( pbc, CONFIG_SUBDIR, CONFIG_FILENAME )
+PORTBUILD_USER = config.get( 'PORTBUILD_USER' )
+
logging.basicConfig(level=logging.INFO,
format='[%(asctime)s] %(message)s',
datefmt='%d %b %Y %H:%M:%S',
More information about the svn-src-projects
mailing list