From: Zhang Qiang Date: Fri, 21 Sep 2012 08:13:56 +0000 (+0800) Subject: Check the format of build conf X-Git-Tag: 0.10^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Frelease-0.10;p=tools%2Fgbs.git Check the format of build conf build conf must end with .conf and can't contain '-'. Change-Id: I44dc370b40844a0c1b911c50cd4f22cfe644bd5c --- diff --git a/gitbuildsys/cmd_build.py b/gitbuildsys/cmd_build.py index c73ed4c..e823bc4 100644 --- a/gitbuildsys/cmd_build.py +++ b/gitbuildsys/cmd_build.py @@ -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)]