add ks_dir and image_dir for gbs conf
authorZhang Qiang <qiang.z.zhang@intel.com>
Thu, 18 Apr 2013 02:30:55 +0000 (10:30 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Sat, 20 Apr 2013 07:57:59 +0000 (15:57 +0800)
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
tests/test_profile.py

index ce0ed292d3259390da38ee3c19bcf4835d34021e..d92d33b1afd098b45fb2816362476f73bc834ff8 100644 (file)
@@ -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
 
index a8690d393912cbc8bbd37b4f989062165e071072..909635744d621bdf7327864a69c65a5ddacf20b2 100644 (file)
@@ -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