From eebbb47d86c6608bfb24a540b4ad4aac661b9bae Mon Sep 17 00:00:00 2001 From: Zhang Qiang Date: Thu, 18 Apr 2013 10:30:55 +0800 Subject: [PATCH] add ks_dir and image_dir for gbs conf ks_dir and image_dir have default value in [general] seciton, and each profile sections can set their own values Change-Id: Ib5999fb5cb9c4fa300852aa76c1cf19f655bca5d --- gitbuildsys/conf.py | 8 +++++++- tests/test_profile.py | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gitbuildsys/conf.py b/gitbuildsys/conf.py index ce0ed29..d92d33b 100644 --- a/gitbuildsys/conf.py +++ b/gitbuildsys/conf.py @@ -175,8 +175,10 @@ class ConfigMgr(object): 'upstream_branch': 'upstream', 'upstream_tag': 'upstream/${upstreamversion}', 'squash_patches_until': '', - 'buildroot': '~/GBS-ROOT/', + 'buildroot': '~/GBS-ROOT', 'packaging_dir': 'packaging', + 'image_dir': '%(buildroot)s/images', + 'ks_dir': '%(buildroot)s/meta/ks-dir', }, } @@ -424,6 +426,8 @@ class Profile(object): self.repos = [] self.obs = None self.buildroot = None + self.image_dir = None + self.ks_dir = None def add_repo(self, repoconf): '''add a repo to repo list of the profile''' @@ -557,6 +561,8 @@ class BizConfigManager(ConfigMgr): profile.add_repo(repoconf) profile.buildroot = self.get_optional_item(name, 'buildroot') + profile.ks_dir = self.get_optional_item(name, 'ks_dir') + profile.image_dir = self.get_optional_item(name, 'image_dir') return profile diff --git a/tests/test_profile.py b/tests/test_profile.py index a8690d3..9096357 100644 --- a/tests/test_profile.py +++ b/tests/test_profile.py @@ -175,6 +175,8 @@ class ConvertTest(unittest.TestCase): self.assertEquals(conf.getvalue(), '''[general] profile = profile.current +image_dir = ~/GBS-ROOT/images +ks_dir = ~/GBS-ROOT/meta/ks-dir [obs.remotebuild] url = https://api/build/server -- 2.7.4