fix lose efficacy issue of getting tmpdir if -c specfied
authorZhang Qiang <qiang.z.zhang@intel.com>
Tue, 25 Jun 2013 03:46:52 +0000 (11:46 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Tue, 25 Jun 2013 03:48:41 +0000 (11:48 +0800)
Change-Id: I05670479ae4fef747a748c80c94e39c022a93a6f
Signed-off-by: Zhang Qiang <qiang.z.zhang@intel.com>
gitbuildsys/cmd_build.py

index 5012a2e..221c34d 100644 (file)
@@ -72,7 +72,7 @@ QEMU_CAN_BUILD = ['armv4l', 'armv5el', 'armv5l', 'armv6l', 'armv7l',
                   ]
 
 USERID = pwd.getpwuid(os.getuid())[0]
-TMPDIR = os.path.join(configmgr.get('tmpdir', 'general'), '%s-gbs' % USERID)
+TMPDIR = None
 
 def prepare_repos_and_build_conf(args, arch, profile):
     '''generate repos and build conf options for depanneur'''
@@ -203,6 +203,9 @@ def get_profile(args):
 def main(args):
     """gbs build entry point."""
 
+    global TMPDIR
+    TMPDIR = os.path.join(configmgr.get('tmpdir', 'general'), '%s-gbs' % USERID)
+
     if args.commit and args.include_all:
         raise Usage('--commit can\'t be specified together with '\
                     '--include-all')