Used username to construct a path to gbs cache.
authorEd Bartosh <eduard.bartosh@intel.com>
Tue, 24 Jul 2012 13:39:42 +0000 (16:39 +0300)
committerEd Bartosh <eduard.bartosh@intel.com>
Tue, 24 Jul 2012 13:50:04 +0000 (16:50 +0300)
Without this change /var/tmp/gbscashe is owned by the user,
who created it. This causes 'permission denied' traceback when trying
to update repository metadata by another user running gbs build.

Fixes #190 and #197.

Change-Id: Ib3df0b215202553b5be1fb5e328cac334a5519b1

gitbuildsys/cmd_build.py

index 35b7d75562f59f3928a5250ab832af3f65321e99..537902faf458d268936fa59733bb28b823f0e8ef 100644 (file)
@@ -352,7 +352,7 @@ def do(opts, args):
         cmd += ['--no-init']
     else:
         # check & prepare repos and build conf if no noinit option
-        cachedir = os.path.join(configmgr.get('tmpdir'), 'gbscache')
+        cachedir = os.path.join(tmpdir, userid, 'gbscache')
         if not os.path.exists(cachedir):
             os.makedirs(cachedir)
         msger.info('generate repositories ...')