From 4ede4f0093d70bc04a827556a5e03e6a78f75c64 Mon Sep 17 00:00:00 2001 From: Zhang Qiang Date: Mon, 15 Jul 2013 15:25:32 +0800 Subject: [PATCH] formalize profile name to build conf, fix #1051 profile name is used to generate build conf, which has some special format: - should not start with digital - should not contain '-' This patch generate well formated build conf file name from profile name. Change-Id: Iee69c0abf8316227cbb6e2845ce11bbb2eaf03e3 --- gitbuildsys/cmd_build.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gitbuildsys/cmd_build.py b/gitbuildsys/cmd_build.py index b98307d..606c282 100644 --- a/gitbuildsys/cmd_build.py +++ b/gitbuildsys/cmd_build.py @@ -75,6 +75,18 @@ QEMU_CAN_BUILD = ['armv4l', 'armv5el', 'armv5l', 'armv6l', 'armv7l', USERID = pwd.getpwuid(os.getuid())[0] TMPDIR = None +def formalize_build_conf(profile): + ''' formalize build conf file name from profile''' + + # build conf file name should not start with digital, see: + # obs-build/Build.pm:read_config_dist() + start_digital_re = re.compile(r'^[0-9]') + if start_digital_re.match(profile): + profile = 'tizen%s' % profile + + # '-' is not allowed, so replace with '_' + return profile.replace('-', '_'); + def prepare_repos_and_build_conf(args, arch, profile): '''generate repos and build conf options for depanneur''' @@ -117,7 +129,7 @@ def prepare_repos_and_build_conf(args, arch, profile): cmd_opts += [('--repository=%s' % url.full) for url in repourls] profile = get_profile(args) - profile_name = profile.name.replace('profile.', '', 1) + profile_name = formalize_build_conf(profile.name.replace('profile.', '', 1)) distconf = os.path.join(TMPDIR, '%s.conf' % profile_name) if args.dist: -- 2.7.4