Check the format of build conf release-0.10 0.10
authorZhang Qiang <qiang.z.zhang@intel.com>
Fri, 21 Sep 2012 08:13:56 +0000 (16:13 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Fri, 21 Sep 2012 08:15:11 +0000 (16:15 +0800)
build conf must end with .conf and can't contain '-'.

Change-Id: I44dc370b40844a0c1b911c50cd4f22cfe644bd5c

gitbuildsys/cmd_build.py

index c73ed4c1417bcb4ebb50f21e3bbe400429917595..e823bc49fd18b5cfbcad4c4743bdc0d8f85c689f 100644 (file)
@@ -120,9 +120,10 @@ def prepare_repos_and_build_conf(opts, arch):
     # must use abspath here, because build command will also use this path
     distconf = os.path.abspath(distconf)
 
-    target_conf = os.path.basename(distconf).replace('-', '')
-    os.rename(distconf, os.path.join(os.path.dirname(distconf), target_conf))
-    dist = target_conf.rsplit('.', 1)[0]
+    if not distconf.endswith('.conf') or '-' in os.path.basename(distconf):
+        msger.error("build config file must end with .conf, and can't "
+                    "contain '-'")
+    dist = os.path.basename(distconf)[:-len('.conf')]
     cmd_opts += ['--dist=%s' % dist]
     cmd_opts += ['--configdir=%s' % os.path.dirname(distconf)]