summaryrefslogtreecommitdiff
path: root/tools/buildman/bsettings.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2013-04-03 11:07:16 +0000
committerSimon Glass <sjg@chromium.org>2013-04-04 14:04:35 -0700
commitfc3fe1c287fc5ee4c528b4059405571fcd2d55bd (patch)
treefe113dd4e9f515ef205d201f528498626193888e /tools/buildman/bsettings.py
parent3fefd5efa664adc06ed49547e817f3e328266a15 (diff)
downloadu-boot-imx-fc3fe1c287fc5ee4c528b4059405571fcd2d55bd.zip
u-boot-imx-fc3fe1c287fc5ee4c528b4059405571fcd2d55bd.tar.gz
u-boot-imx-fc3fe1c287fc5ee4c528b4059405571fcd2d55bd.tar.bz2
buildman - U-Boot multi-threaded builder and summary tool
This tool handles building U-Boot to check that you have not broken it with your patch series. It can build each individual commit and report which boards fail on which commits, and which errors come up. It also shows differences in image sizes due to particular commits. Buildman aims to make full use of multi-processor machines. Documentation and caveats are in tools/buildman/README. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/buildman/bsettings.py')
-rw-r--r--tools/buildman/bsettings.py60
1 files changed, 60 insertions, 0 deletions
diff --git a/tools/buildman/bsettings.py b/tools/buildman/bsettings.py
new file mode 100644
index 0000000..7e66c63
--- /dev/null
+++ b/tools/buildman/bsettings.py
@@ -0,0 +1,60 @@
+# Copyright (c) 2012 The Chromium OS Authors.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+import ConfigParser
+import os
+
+
+def Setup(fname=''):
+ """Set up the buildman settings module by reading config files
+
+ Args:
+ config_fname: Config filename to read ('' for default)
+ """
+ global settings
+ global config_fname
+
+ settings = ConfigParser.SafeConfigParser()
+ config_fname = fname
+ if config_fname == '':
+ config_fname = '%s/.buildman' % os.getenv('HOME')
+ if config_fname:
+ settings.read(config_fname)
+
+def GetItems(section):
+ """Get the items from a section of the config.
+
+ Args:
+ section: name of section to retrieve
+
+ Returns:
+ List of (name, value) tuples for the section
+ """
+ try:
+ return settings.items(section)
+ except ConfigParser.NoSectionError as e:
+ print e
+ print ("Warning: No tool chains - please add a [toolchain] section "
+ "to your buildman config file %s. See README for details" %
+ config_fname)
+ return []
+ except:
+ raise