Used username as part of temporary directory.
authorEd Bartosh <eduard.bartosh@intel.com>
Thu, 30 Aug 2012 08:29:21 +0000 (11:29 +0300)
committerEd Bartosh <eduard.bartosh@intel.com>
Fri, 31 Aug 2012 10:33:48 +0000 (13:33 +0300)
Temporary directory is used as a base path for buildroot, cachedir and
others temporary directories. Making it to contain username solves
conflicts when gbs is run by more than one user on the same machine at
the same time.

Fixes: #283, #278, #244

Change-Id: Iafb9f83691e945d7148ef70f059096dada2cc701

gitbuildsys/cmd_build.py

index 7fa6761..bebefb6 100644 (file)
@@ -261,8 +261,8 @@ def do(opts, args):
 
     build_cmd  = configmgr.get('build_cmd', 'build')
     userid     = pwd.getpwuid(os.getuid())[0]
-    tmpdir     = configmgr.get('tmpdir', 'general')
-    build_root = os.path.join(tmpdir, userid, 'gbs-buildroot.%s' % buildarch)
+    tmpdir     = os.path.join(configmgr.get('tmpdir', 'general'),  "%s-gbs" % userid)
+    build_root = os.path.join(tmpdir, 'gbs-buildroot.%s' % buildarch)
     if opts.buildroot:
         build_root = opts.buildroot
     cmd = [ build_cmd,