Supporting new profile key 'exclude_packages'
authorZhang Qiang <qiang.z.zhang@intel.com>
Thu, 15 May 2014 15:56:30 +0000 (23:56 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Mon, 19 May 2014 03:28:48 +0000 (11:28 +0800)
Tizen packages always have dependencies circles, and current gbs
does not support building multiple packages with circles. so
developer have to use --exclude option to exclude them every build
time.

This patch introduce exclude_packages to make user can configure
it in profile section.

Fixes: #1882

Change-Id: I3ab52fe2e405e0ebc009d14d230af8d3a638a4a7

gitbuildsys/cmd_build.py
gitbuildsys/conf.py

index 0d77626..63022ee 100644 (file)
@@ -305,6 +305,13 @@ def main(args):
     sanitized_profile_name = re.sub("[^a-zA-Z0-9:._-]", "_", profile.name)
     build_root = build_root % {'tmpdir': TMPDIR,
                                'profile': sanitized_profile_name}
+    if profile.exclude_packages:
+        log.info('the following packages have been excluded build from gbs '
+                 'config:\n   %s' % '\n   '.join(profile.exclude_packages))
+        if args.exclude:
+            args.exclude += ',' + ','.join(profile.exclude_packages)
+        else:
+            args.exclude = ','.join(profile.exclude_packages)
     os.environ['TIZEN_BUILD_ROOT'] = os.path.abspath(build_root)
 
     # get virtual env from system env first
index f1ea4df..95600eb 100644 (file)
@@ -202,6 +202,11 @@ obs = obs.tizen
 #Comma separated list of repositories
 repos = repo.tizen_latest
 #repos = repo.tizen_main, repo.tizen_base
+#Build config for gbs build
+#buildconf = <patch/to/build-config-file>
+#Comma separated list of additional packages be excluded building
+#exclude_packages = libtool,gettext
+
 
 [obs.tizen]
 #OBS API URL pointing to a remote OBS.
@@ -485,6 +490,7 @@ class Profile(object):
         self.obs = None
         self.buildroot = None
         self.buildconf = None
+        self.exclude_packages = []
 
     def add_repo(self, repoconf):
         '''add a repo to repo list of the profile'''
@@ -643,6 +649,12 @@ class BizConfigManager(ConfigMgr):
             profile.buildconf = os.path.expanduser(self._interpolate(
                                                    self.get_optional_item(name,
                                                    'buildconf')))
+        if self.get_optional_item(name, 'exclude_packages'):
+            exclude_val = self.get_optional_item(name, 'exclude_packages')
+            for pkg in exclude_val.split(','):
+                if pkg.strip():
+                    profile.exclude_packages.append(pkg.strip());
+
         return profile
 
     def _parse_build_repos(self):