copy build conf to $tmpdir/ for --noinit use
authorZhang Qiang <qiang.z.zhang@intel.com>
Tue, 14 Aug 2012 07:41:11 +0000 (15:41 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Tue, 14 Aug 2012 07:41:11 +0000 (15:41 +0800)
gitbuildsys/cmd_build.py

index 7c5fa3f..cac8960 100644 (file)
@@ -301,7 +301,8 @@ def do(opts, args):
         cmd += ['--no-init']
     else:
         # check & prepare repos and build conf if no noinit option
-        cache = utils.Temp(prefix=os.path.join(tmpdir, 'gbscache'), directory=True)
+        cache = utils.Temp(prefix=os.path.join(tmpdir, 'gbscache'),
+                           directory=True)
         cachedir  = cache.path
         if not os.path.exists(cachedir):
             os.makedirs(cachedir)
@@ -332,11 +333,13 @@ def do(opts, args):
         if opts.dist:
             distconf = opts.dist
         else:
-            distconf = repoparser.buildconf
-            if distconf is None:
+            if repoparser.buildconf is None:
                 msger.info('failed to get build conf, use default build conf')
                 distconf = configmgr.get('distconf', 'build')
             else:
+                shutil.copy(repoparser.buildconf, tmpdir)
+                distconf = os.path.join(tmpdir, os.path.basename(\
+                                        repoparser.buildconf))
                 msger.info('build conf has been downloaded at:\n      %s' \
                            % distconf)