Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Dec 2012 16:12:16 +0000 (UTC)
From:      Mark Linimon <linimon@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r244222 - projects/portbuild/scripts
Message-ID:  <201212141612.qBEGCGVa094560@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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',



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212141612.qBEGCGVa094560>