From ffe31992dd4796c576ab58b61d61bbb772b982f0 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sat, 17 Jan 2009 18:54:42 +0000 Subject: Big refactoring by David Farning. --- diff --git a/sbuildbot/AUTHORS b/sbuildbot/AUTHORS new file mode 100644 index 0000000..01194e8 --- /dev/null +++ b/sbuildbot/AUTHORS @@ -0,0 +1,5 @@ +John Carr +Frederic Peters +Alejandro PiƱeiro +Iago Toral +Jose Dapena diff --git a/sbuildbot/Makefile b/sbuildbot/Makefile new file mode 100644 index 0000000..5f79e59 --- /dev/null +++ b/sbuildbot/Makefile @@ -0,0 +1,19 @@ +# -*- makefile -*- + +# This is a simple makefile which lives in a buildmaster/buildslave +# directory (next to the buildbot.tac file). It allows you to start/stop the +# master or slave by doing 'make start' or 'make stop'. + +# The 'reconfig' target will tell a buildmaster to reload its config file. + +start: + twistd --no_save -y buildbot.tac --nodaemon + +stop: + kill `cat twistd.pid` + +reconfig: + kill -HUP `cat twistd.pid` + +log: + tail -f twistd.log diff --git a/sbuildbot/README b/sbuildbot/README new file mode 100644 index 0000000..cafbebb --- /dev/null +++ b/sbuildbot/README @@ -0,0 +1,5 @@ +You must at minimum edit those two lines in master.cfg: + c['jhbuild'] = "~/bin/jhbuild" + c['jhbuildrc'] = "/home/fred/.jhbuildrc" + +You must also define slaves in the slaves.csv file. diff --git a/sbuildbot/buildbot.tac b/sbuildbot/buildbot.tac new file mode 100644 index 0000000..e97e732 --- /dev/null +++ b/sbuildbot/buildbot.tac @@ -0,0 +1,12 @@ +from twisted.application import service +from buildbot.master import BuildMaster +import os + +basedir = os.path.dirname(os.path.abspath(__file__)) +if not os.path.exists(os.path.join(basedir, 'builddir')): + os.makedirs(os.path.join(basedir, 'builddir')) +configfile = r'master.cfg' + +application = service.Application('buildmaster') +BuildMaster(basedir, configfile).setServiceParent(application) + diff --git a/sbuildbot/master.cfg b/sbuildbot/master.cfg new file mode 100644 index 0000000..381f3d5 --- /dev/null +++ b/sbuildbot/master.cfg @@ -0,0 +1,80 @@ +# -*- python -*- +# ex: set syntax=python: + +# This is a sample buildmaster config file. It must be installed as +# 'master.cfg' in your buildmaster's base directory (although the filename +# can be changed with the --basedir option to 'mktap buildbot master'). + +# It has one job: define a dictionary named BuildmasterConfig. This +# dictionary has a variety of keys to control different aspects of the +# buildmaster. They are documented in docs/config.xhtml . + +import buildbot + +# This is the dictionary that the buildmaster pays attention to. We also use +# a shorter alias to save typing. +c = BuildmasterConfig = {} + +# 'slavePortnum' defines the TCP port to listen on. This must match the value +# configured into the buildslaves (with their --master option) + +c['slavePortnum'] = 9070 + +####### STATUS TARGETS + +# 'status' is a list of Status Targets. The results of each build will be +# pushed to these targets. buildbot/status/*.py has a variety to choose from, +# including web pages, email senders, and IRC bots. + +c['status'] = [] + +# from buildbot.status import mail +# c['status'].append(mail.MailNotifier(fromaddr="buildbot@localhost", +# extraRecipients=["builds@example.com"], +# sendToInterestedUsers=False)) +# +from buildbot.status import words +c['status'].append(words.IRC(host="irc.freenode.net", nick="buildbot", + channels=["#sugar"], port=8001)) +# +# from buildbot.status import client +# c['status'].append(client.PBListener(9988)) + + +####### DEBUGGING OPTIONS + +# if you set 'debugPassword', then you can connect to the buildmaster with +# the diagnostic tool in contrib/debugclient.py . From this tool, you can +# manually force builds and inject changes, which may be useful for testing +# your buildmaster without actually commiting changes to your repository (or +# before you have a functioning 'sources' set up). The debug tool uses the +# same port number as the slaves do: 'slavePortnum'. + +#c['debugPassword'] = "debugpassword" + +# if you set 'manhole', you can ssh into the buildmaster and get an +# interactive python shell, which may be useful for debugging buildbot +# internals. It is probably only useful for buildbot developers. You can also +# use an authorized_keys file, or plain telnet. +#from buildbot import manhole +#c['manhole'] = manhole.PasswordManhole("tcp:9999:interface=127.0.0.1", +# "admin", "password") + + +####### PROJECT IDENTITY + +# the 'projectName' string will be used to describe the project that this +# buildbot is working on. For example, it is used as the title of the +# waterfall HTML page. The 'projectURL' string will be used to provide a link +# from buildbot HTML pages to your project's home page. + +c['projectName'] = "Sugar Labs Buildbot" +c['projectURL'] = "http://www.sugarlabs.org" + +# the 'buildbotURL' string should point to the location where the buildbot's +# internal web server (usually the html.Waterfall page) is visible. This +# typically uses the port number set in the Waterfall 'status' entry, but +# with an externally-visible host name which the buildbot cannot figure out +# without some help. + +c['buildbotURL'] = "http://buildbot.sugarlabs.org:8080/" diff --git a/sbuildbot/public_html/bar.png b/sbuildbot/public_html/bar.png new file mode 100644 index 0000000..e5b354e --- /dev/null +++ b/sbuildbot/public_html/bar.png Binary files differ diff --git a/sbuildbot/public_html/building.png b/sbuildbot/public_html/building.png new file mode 100644 index 0000000..46ad8a0 --- /dev/null +++ b/sbuildbot/public_html/building.png Binary files differ diff --git a/sbuildbot/public_html/cyan-bar.png b/sbuildbot/public_html/cyan-bar.png new file mode 100644 index 0000000..6c44fdf --- /dev/null +++ b/sbuildbot/public_html/cyan-bar.png Binary files differ diff --git a/sbuildbot/public_html/download.png b/sbuildbot/public_html/download.png new file mode 100644 index 0000000..cf1945c --- /dev/null +++ b/sbuildbot/public_html/download.png Binary files differ diff --git a/sbuildbot/public_html/emptyimg.png b/sbuildbot/public_html/emptyimg.png new file mode 100644 index 0000000..9b63c56 --- /dev/null +++ b/sbuildbot/public_html/emptyimg.png Binary files differ diff --git a/sbuildbot/public_html/error.png b/sbuildbot/public_html/error.png new file mode 100644 index 0000000..4c485f7 --- /dev/null +++ b/sbuildbot/public_html/error.png Binary files differ diff --git a/sbuildbot/public_html/feed-atom.png b/sbuildbot/public_html/feed-atom.png new file mode 100644 index 0000000..c8d70ca --- /dev/null +++ b/sbuildbot/public_html/feed-atom.png Binary files differ diff --git a/sbuildbot/public_html/feed.png b/sbuildbot/public_html/feed.png new file mode 100644 index 0000000..eb47e19 --- /dev/null +++ b/sbuildbot/public_html/feed.png Binary files differ diff --git a/sbuildbot/public_html/figure.png b/sbuildbot/public_html/figure.png new file mode 100644 index 0000000..18aac33 --- /dev/null +++ b/sbuildbot/public_html/figure.png Binary files differ diff --git a/sbuildbot/public_html/foot-16.png b/sbuildbot/public_html/foot-16.png new file mode 100644 index 0000000..95c4ff6 --- /dev/null +++ b/sbuildbot/public_html/foot-16.png Binary files differ diff --git a/sbuildbot/public_html/foot.png b/sbuildbot/public_html/foot.png new file mode 100644 index 0000000..1138da1 --- /dev/null +++ b/sbuildbot/public_html/foot.png Binary files differ diff --git a/sbuildbot/public_html/general_bg.png b/sbuildbot/public_html/general_bg.png new file mode 100644 index 0000000..8840fe2 --- /dev/null +++ b/sbuildbot/public_html/general_bg.png Binary files differ diff --git a/sbuildbot/public_html/general_separator.png b/sbuildbot/public_html/general_separator.png new file mode 100644 index 0000000..bd865e8 --- /dev/null +++ b/sbuildbot/public_html/general_separator.png Binary files differ diff --git a/sbuildbot/public_html/gnome-16.png b/sbuildbot/public_html/gnome-16.png new file mode 100644 index 0000000..95c4ff6 --- /dev/null +++ b/sbuildbot/public_html/gnome-16.png Binary files differ diff --git a/sbuildbot/public_html/gnome-64.png b/sbuildbot/public_html/gnome-64.png new file mode 100644 index 0000000..09a3184 --- /dev/null +++ b/sbuildbot/public_html/gnome-64.png Binary files differ diff --git a/sbuildbot/public_html/gnome-gtp.png b/sbuildbot/public_html/gnome-gtp.png new file mode 100644 index 0000000..c7ed133 --- /dev/null +++ b/sbuildbot/public_html/gnome-gtp.png Binary files differ diff --git a/sbuildbot/public_html/green-bar.png b/sbuildbot/public_html/green-bar.png new file mode 100644 index 0000000..d02dd14 --- /dev/null +++ b/sbuildbot/public_html/green-bar.png Binary files differ diff --git a/sbuildbot/public_html/idle.png b/sbuildbot/public_html/idle.png new file mode 100644 index 0000000..4f031b7 --- /dev/null +++ b/sbuildbot/public_html/idle.png Binary files differ diff --git a/sbuildbot/public_html/images.jpeg b/sbuildbot/public_html/images.jpeg new file mode 100644 index 0000000..54730ee --- /dev/null +++ b/sbuildbot/public_html/images.jpeg Binary files differ diff --git a/sbuildbot/public_html/info.png b/sbuildbot/public_html/info.png new file mode 100644 index 0000000..bbd5dba --- /dev/null +++ b/sbuildbot/public_html/info.png Binary files differ diff --git a/sbuildbot/public_html/lgo.css b/sbuildbot/public_html/lgo.css new file mode 100644 index 0000000..861cc83 --- /dev/null +++ b/sbuildbot/public_html/lgo.css @@ -0,0 +1,365 @@ +body { + margin: 0px; + padding: 0px; + font-family: sans-serif; + background: white; + color: black; + height: 101%; +} + +body.with-star { + background: white url(star.png) -100px -200px no-repeat; +} + +#page { + margin: 0px; + padding: 0px; +} + +div.in-column { + margin: 0 0 2em 1em; + float: right; + max-width: 12em; +} + +hr { + color: #888; + background: #888; + border: 0; + height: 1px; + width: 90%; + text-align: center; + clear: both; +} + + +div.body { + clear: both; +} + + +div.sidebar { + position: absolute; + text-align: left; + right: 0px; + top: 60px; + width: 27ex; + padding-left: 1ex; + border-left: 1ex solid #eee; + margin-top: 4em; +} + +div.sidebar h2 { + margin-top: 0; + padding: 5px 2ex 5px 2ex; + background: url(t.png) top left repeat-y; + font-size: 100%; +} + +#general { + list-style: none; + background: #2E3436 url(general_bg.png) 0 100% repeat-x; + text-align: right; + padding: 0 1ex; + margin: 0; + font-size: 70%; +} + +#general li { + display: inline; + background: url(general_separator.png) 0 0 no-repeat; + padding-top: 10px; + padding-bottom: 8px; + margin-left: 0px; + margin-top: 0px; +} + +#general li a { + font-weight: bold; + color: #FFFFFF; + margin: 0 2ex; + text-decoration: none; + line-height: 30px; +} + +#general li a:hover { + text-decoration: underline; +} + +#general .home { + float: left; + background: url(general_separator.png) 100% 0 no-repeat; + padding-top: 0; + padding-bottom: 0; +} + +#general .home a { + float: left; + background: url(foot.png) 7px 50% no-repeat; + margin-left: 0; + padding-left: 27px; +} + + +#header { + background: #729FCF url(robot.png) 15px 12px no-repeat; + float: left; + width: 100%; + font-size: 75%; +} + +#header h1 { + margin: 0; + margin-left: 85px; + padding-top: 25px; + font-size: 200%; + color: #eeeeec; +} + +#header h1 a { + text-decoration: inherit; + color: inherit; +} + +#tabs { + background: url(bar.png) 0 100% repeat-x; + width: 100%; + float: left; + margin: 0; + padding: 0; +} + +#portal-globalnav { + float: right; + list-style: none; + margin: 0; + margin-right: 3ex; +} + +#portal-globalnav li { + float: left; + margin: 0; + margin-left: 0.2ex; + font-size: 2ex; +} + +#portal-globalnav li a:hover { + color: #111111; +} + +#portal-globalnav li a { + float: left; + text-decoration: none; + color: #555555; + background: url(tab_left.png) 0 0 no-repeat; + padding: 7px 0 7px 7px; + border-bottom: 2px solid #CCCCCC; +} + +#portal-globalnav li span { + background: url(tab_right.png) 100% 0 no-repeat; + padding: 7px 28px 7px 19px; +} + +#portal-globalnav li.selected a { + color: #3566A5; + background: url(tab_left.png) 0 -57px no-repeat; + border-bottom: none; + padding-top: 8px; + padding-bottom: 8px; +} + +#portal-globalnav li.selected a span { + background: url(tab_right.png) 100% -57px no-repeat; + padding-top: 8px; + padding-bottom: 8px; +} + +div.body { + background-color: transparent; + border: none; + padding: 1em; +} + +div.body-sidebar { + margin-right: 27ex; +} + +a { + color: #3465a4; +} + +div.navbar { + margin: 0 29ex 0 2ex; +} + +a img { + border: none; +} + +div#footer { + border-top: 1px solid gray; + color: #888; + font-size: 80%; + margin: 3em 3em 1em; + padding-top: 1.5em; + text-align: center; +} + +/* Buildbot stuff */ + +table.ProjectSummary tbody th { + text-align: left; +} + +table.ProjectSummary thead td { + text-align: center; +} + +table.ProjectSummary tbody td { + border: 1px solid #888; + padding: 0 3px; + text-align: center; +} + +table.ProjectSummary tbody td.feed { + border: none; + padding-right: 2px; +} + +th.offline, th.idle, th.building { + background: white url(offline.png) center right no-repeat; + padding: 0 16px; + cursor: help; +} + +th.idle { + background-image: url(idle.png); +} + +th.building { + background-image: url(building.png); +} + +th.offline { + color: #888; +} + +.success { + background: #8f8; +} + +.failure { + background: #f88; +} +td.running, +td.building { + background: #ff8; +} +td.idle { + color: #888; + background: #f8f8f8; +} +td.offline { + color: #000; + background: #f88; +} +td.failedchecks { + background: #fa4; +} + + +table.waterfall { +} + +table.waterfall td.Time { + background: #e0e0e0; + border: 1px solid #888; + text-align: center; + padding: 0 2px; +} + +table.waterfall td.LastBuild, +table.waterfall td.BuildStep { + border: 1px solid #888; +} + +table.waterfall .Change { + padding-right: 1em; +} + +table.waterfall td.start { + background: #ff8; + font-weight: bold; +} + +table.waterfall td.start a { + text-decoration: none; +} + +table.waterfall td.exception { + border: 3px solid red; + background: #c66; +} + +/* From classic */ +/* +td.Change, td.Time, td.Event { + background: #e0e0e0; +} + +td.Event, td.BuildStep, td.Activity, td.Change, td.Time, td.Builder, td.LastBuild { + border-top: 1px solid; + border-right: 1px solid; + border-bottom: 1px solid; + border-left: 1px solid; +} +*/ + +tr.totals td { + padding-top: 1ex; + text-align: center; + font-weight: bold; +} + +div.changeset ul { + margin-left: 0em; + padding-left: 0em; + list-style: none; +} + +div.changeset ul ul { + padding-left: 1em; +} + +ul#tests-summary { + margin: 1em; + padding: 0; + list-style: none; + -webkit-column-width: 15em; + -moz-column-width: 15em; + column-width: 15em; + -webkit-column-gap: 1em; + -moz-column-gap: 1em; + column-gap: 1em; +} + +ul#tests-summary li { + margin-bottom: 1ex; +} + +li.changeset { + border: 1px dashed #555; + background: #eee; + padding: 1ex; + font-size: 80%; + margin-bottom: 1em; +} + +li.changeset p { + margin: 0; +} + +li.changeset pre { + margin: 0; +} diff --git a/sbuildbot/public_html/logo.png b/sbuildbot/public_html/logo.png new file mode 100644 index 0000000..06e0940 --- /dev/null +++ b/sbuildbot/public_html/logo.png Binary files differ diff --git a/sbuildbot/public_html/media b/sbuildbot/public_html/media new file mode 120000 index 0000000..b8424c4 --- /dev/null +++ b/sbuildbot/public_html/media @@ -0,0 +1 @@ +/var/www/sugarlabs/media/ \ No newline at end of file diff --git a/sbuildbot/public_html/nobody.png b/sbuildbot/public_html/nobody.png new file mode 100644 index 0000000..dee7669 --- /dev/null +++ b/sbuildbot/public_html/nobody.png Binary files differ diff --git a/sbuildbot/public_html/offline.png b/sbuildbot/public_html/offline.png new file mode 100644 index 0000000..bc9a1b7 --- /dev/null +++ b/sbuildbot/public_html/offline.png Binary files differ diff --git a/sbuildbot/public_html/purple-bar.png b/sbuildbot/public_html/purple-bar.png new file mode 100644 index 0000000..0c35c53 --- /dev/null +++ b/sbuildbot/public_html/purple-bar.png Binary files differ diff --git a/sbuildbot/public_html/red-bar.png b/sbuildbot/public_html/red-bar.png new file mode 100644 index 0000000..3439fd5 --- /dev/null +++ b/sbuildbot/public_html/red-bar.png Binary files differ diff --git a/sbuildbot/public_html/robot.png b/sbuildbot/public_html/robot.png new file mode 100644 index 0000000..65a5304 --- /dev/null +++ b/sbuildbot/public_html/robot.png Binary files differ diff --git a/sbuildbot/public_html/robots.txt b/sbuildbot/public_html/robots.txt new file mode 100644 index 0000000..1f53798 --- /dev/null +++ b/sbuildbot/public_html/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/sbuildbot/public_html/star.png b/sbuildbot/public_html/star.png new file mode 100644 index 0000000..a152a93 --- /dev/null +++ b/sbuildbot/public_html/star.png Binary files differ diff --git a/sbuildbot/public_html/t.png b/sbuildbot/public_html/t.png new file mode 100644 index 0000000..7b67341 --- /dev/null +++ b/sbuildbot/public_html/t.png Binary files differ diff --git a/sbuildbot/public_html/tab_left.png b/sbuildbot/public_html/tab_left.png new file mode 100644 index 0000000..0ead7a1 --- /dev/null +++ b/sbuildbot/public_html/tab_left.png Binary files differ diff --git a/sbuildbot/public_html/tab_right.png b/sbuildbot/public_html/tab_right.png new file mode 100644 index 0000000..2ee74d6 --- /dev/null +++ b/sbuildbot/public_html/tab_right.png Binary files differ diff --git a/sbuildbot/public_html/warn.png b/sbuildbot/public_html/warn.png new file mode 100644 index 0000000..9a8c5bb --- /dev/null +++ b/sbuildbot/public_html/warn.png Binary files differ diff --git a/sbuildbot/public_html/webpage.png b/sbuildbot/public_html/webpage.png new file mode 100644 index 0000000..e5d80c1 --- /dev/null +++ b/sbuildbot/public_html/webpage.png Binary files differ diff --git a/sbuildbot/slaves.csv b/sbuildbot/slaves.csv new file mode 100644 index 0000000..70d0f5c --- /dev/null +++ b/sbuildbot/slaves.csv @@ -0,0 +1,2 @@ +Fedora10,nice +Ubuntu8.10,nice diff --git a/sbuildbot/template.html b/sbuildbot/template.html new file mode 100644 index 0000000..281c85d --- /dev/null +++ b/sbuildbot/template.html @@ -0,0 +1,46 @@ + + + + @@GNOME_BUILDBOT_TITLE@@ + + + + + + +
+ +@@GNOME_BUILDBOT_BODY@@ + + + + + +
+ + diff --git a/scripts/report.py b/scripts/report.py index 0ac8659..3617ee2 100644 --- a/scripts/report.py +++ b/scripts/report.py @@ -183,9 +183,4 @@ try: register_command(cmd_report) except ImportError: - try: - import cjson as json - json.read = json.decode - json.write = json.encode - except ImportError: - print 'Disable report, neither json-py nor python-cjson are not installed.' + print 'Disable report, json-py is not installed.' diff --git a/scripts/bundlemodule.py b/sjhbuild/bundlemodule.py index 3a662c1..3a662c1 100644 --- a/scripts/bundlemodule.py +++ b/sjhbuild/bundlemodule.py diff --git a/sjhbuild/config.py b/sjhbuild/config.py new file mode 100644 index 0000000..d89d69b --- /dev/null +++ b/sjhbuild/config.py @@ -0,0 +1,76 @@ +import os +import sys + +import jhbuild.config + +import sysdeps + +class Config(jhbuild.config.Config): + def __init__(self, base_dir, rc_file): + self.base_dir = base_dir + jhbuild.config.Config.__init__(self, os.path.join(self.base_dir, 'sugar.jhbuildrc')) + self._setup() + + def _setup(self): + self.autogenargs = '' + + self.checkoutroot = os.path.join(self.base_dir, 'source') + self.tarballdir = os.path.join(self.base_dir, 'source') + self.moduleset = os.path.join(self.base_dir, 'sjhbuild/modulesets/sugar.modules') + + for package, source in sysdeps.get_packages(): + if source and source not in self.skip: + self.skip.append(source) + + def setup_env(self): + # Hack to replace the default prefix + if self.prefix == '/opt/gnome2': + self.prefix = os.path.join(self.base_dir, 'install') + + #Hack to allow sugar-jhbuild to find its self again. + + MY_PATH = os.getenv('PATH', 'Error') + os.environ["PATH"] = MY_PATH + ':' + self.base_dir + + jhbuild.config.Config.setup_env(self) + + jhbuild.config.addpath('XDG_DATA_DIRS', '/usr/share') + jhbuild.config.addpath('XDG_DATA_DIRS', os.path.join(self.prefix, 'share')) + + if self.use_lib64: + path = 'lib64/gtk-2.0/' + else: + path = 'lib/gtk-2.0/' + jhbuild.config.addpath('GTK_PATH', os.path.join(self.prefix, path)) + jhbuild.config.addpath('GTK_DATA_PREFIX', self.prefix) + + os.environ['SUGAR_PREFIX'] = self.prefix + os.environ['SUGAR_PATH'] = os.path.join(self.prefix, 'share', 'sugar') + os.environ['SUGAR_LOGGER_LEVEL'] = 'debug' + + # Enable debug log of the Telepathy components + os.environ['GABBLE_DEBUG'] = 'all' + os.environ['SALUT_DEBUG'] = 'all' + os.environ['STREAM_ENGINE_DEBUG'] = 'all' + + # We need to add the gtk-2.0 directory explicitly to + # the Python path since '.pth' files (here pygtk.pth) + # only work properly in system directories + pythonversion = 'python' + str(sys.version_info[0]) + '.' + \ + str(sys.version_info[1]) + if self.use_lib64: + pythonpath = os.path.join(self.prefix, 'lib64', pythonversion, + 'site-packages', 'gtk-2.0') + else: + pythonpath = os.path.join(self.prefix, 'lib', pythonversion, + 'site-packages', 'gtk-2.0') + jhbuild.config.addpath('PYTHONPATH', pythonpath) + + python_lib = os.path.join(self.prefix, 'lib', 'python2.5', 'site-packages') + os.environ['PYTHON_LIB'] = python_lib + + if 'DBUS_SESSION_BUS_ADDRESS' in os.environ: + del os.environ['DBUS_SESSION_BUS_ADDRESS'] + + if not 'SUGAR_PROFILE' in os.environ: + os.environ['SUGAR_PROFILE'] = 'default' diff --git a/sjhbuild/main.py b/sjhbuild/main.py new file mode 100644 index 0000000..be988b9 --- /dev/null +++ b/sjhbuild/main.py @@ -0,0 +1,155 @@ +#!/usr/bin/env python +# jhbuild - a build script for GNOME 1.x and 2.x +# Copyright (C) 2001-2006 James Henstridge +# +# main.py: parses command line arguments and starts the build +# +# 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 sys, os, errno +import optparse +import traceback + +import gettext +localedir = os.path.abspath(os.path.join(os.path.dirname(__file__), '../mo')) +gettext.install('jhbuild', localedir=localedir, unicode=True) +import __builtin__ +__builtin__.__dict__['N_'] = lambda x: x + +import jhbuild.commands +from jhbuild.errors import UsageError, FatalError +from jhbuild.utils.cmds import get_output +from jhbuild.moduleset import warn_local_modulesets + +import bundlemodule + +from config import Config + +if sys.platform == 'darwin': + # work around locale.getpreferredencoding() returning an empty string in + # Mac OS X, see http://bugzilla.gnome.org/show_bug.cgi?id=534650 and + # http://bazaar-vcs.org/DarwinCommandLineArgumentDecoding + sys.platform = 'posix' + try: + import locale + finally: + sys.platform = 'darwin' +else: + import locale + +try: + _encoding = locale.getpreferredencoding() + assert _encoding +except (locale.Error, AssertionError): + _encoding = 'ascii' + +def uencode(s): + if type(s) is unicode: + return s.encode(_encoding, 'replace') + else: + return s + +def uprint(*args): + '''Print Unicode string encoded for the terminal''' + for s in args[:-1]: + print uencode(s), + s = args[-1] + print uencode(s) + +__builtin__.__dict__['uprint'] = uprint +__builtin__.__dict__['uencode'] = uencode + +def help_commands(option, opt_str, value, parser): + thisdir = os.path.abspath(os.path.dirname(__file__)) + + # import all available commands + for fname in os.listdir(os.path.join(thisdir, 'commands')): + name, ext = os.path.splitext(fname) + if not ext == '.py': + continue + try: + __import__('jhbuild.commands.%s' % name) + except ImportError: + pass + + uprint(_('JHBuild commands are:')) + commands = [(x.name, x.doc) for x in jhbuild.commands.get_commands().values()] + commands.sort() + for name, description in commands: + uprint(' %-15s %s' % (name, description)) + print + uprint(_('For more information run "jhbuild --help"')) + parser.exit() + +def main(base_dir, args): + parser = optparse.OptionParser( + usage=_('%prog [ -f config ] command [ options ... ]'), + description=_('Build a set of modules from diverse repositories in correct dependency order (such as GNOME).')) + parser.disable_interspersed_args() + parser.add_option('--help-commands', action='callback', + callback=help_commands, + help=_('Information about available jhbuild commands')) + parser.add_option('-f', '--file', action='store', metavar='CONFIG', + type='string', dest='configfile', + default=os.environ.get("JHBUILDRC", os.path.join(os.environ['HOME'], '.jhbuildrc')), + help=_('use a non default configuration file')) + parser.add_option('-m', '--moduleset', action='store', metavar='URI', + type='string', dest='moduleset', default=None, + help=_('use a non default module set')) + parser.add_option('--no-interact', action='store_true', + dest='nointeract', default=False, + help=_('do not prompt for input')) + + options, args = parser.parse_args(args) + + try: + config = Config(base_dir, options.configfile) + except FatalError, exc: + sys.stderr.write('sugar-jhbuild: %s\n' % exc.args[0].encode(_encoding, 'replace')) + sys.exit(1) + + if options.moduleset: config.moduleset = options.moduleset + if options.nointeract: config.interact = False + + if not args or args[0][0] == '-': + command = 'build' # default to cvs update + compile + else: + command = args[0] + args = args[1:] + + warn_local_modulesets(config) + + try: + rc = jhbuild.commands.run(command, config, args) + except UsageError, exc: + sys.stderr.write('sugar-jhbuild %s: %s\n' % (command, exc.args[0].encode(_encoding, 'replace'))) + parser.print_usage() + sys.exit(1) + except FatalError, exc: + sys.stderr.write('sugar-jhbuild %s: %s\n' % (command, exc.args[0].encode(_encoding, 'replace'))) + sys.exit(1) + except KeyboardInterrupt: + uprint(_('Interrupted')) + sys.exit(1) + except EOFError: + uprint(_('EOF')) + sys.exit(1) + except IOError, e: + if e.errno != errno.EPIPE: + raise + sys.exit(0) + if rc: + sys.exit(rc) + diff --git a/config/modulesets/extra-activities.modules b/sjhbuild/modulesets/extra-activities.modules index 61c5918..60b4779 100644 --- a/config/modulesets/extra-activities.modules +++ b/sjhbuild/modulesets/extra-activities.modules @@ -69,4 +69,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/modulesets/extra.modules b/sjhbuild/modulesets/extra.modules index 377cf7e..4dde9e3 100644 --- a/config/modulesets/extra.modules +++ b/sjhbuild/modulesets/extra.modules @@ -41,5 +41,14 @@ + + + + + + + + + diff --git a/config/modulesets/fructose.modules b/sjhbuild/modulesets/fructose.modules index 6c12c47..f06b9ad 100644 --- a/config/modulesets/fructose.modules +++ b/sjhbuild/modulesets/fructose.modules @@ -28,7 +28,7 @@ - + diff --git a/config/modulesets/glucose-external.modules b/sjhbuild/modulesets/glucose-external.modules index 4278731..4278731 100644 --- a/config/modulesets/glucose-external.modules +++ b/sjhbuild/modulesets/glucose-external.modules diff --git a/config/modulesets/glucose.modules b/sjhbuild/modulesets/glucose.modules index d70b05f..d70b05f 100644 --- a/config/modulesets/glucose.modules +++ b/sjhbuild/modulesets/glucose.modules diff --git a/config/modulesets/patches/astng-ignoredatadesc.patch b/sjhbuild/modulesets/patches/astng-ignoredatadesc.patch index c527419..c527419 100644 --- a/config/modulesets/patches/astng-ignoredatadesc.patch +++ b/sjhbuild/modulesets/patches/astng-ignoredatadesc.patch diff --git a/config/modulesets/patches/gconf-dbus-defaultpath.patch b/sjhbuild/modulesets/patches/gconf-dbus-defaultpath.patch index f792566..f792566 100644 --- a/config/modulesets/patches/gconf-dbus-defaultpath.patch +++ b/sjhbuild/modulesets/patches/gconf-dbus-defaultpath.patch diff --git a/config/modulesets/patches/gstreamer_system_clock_wait_jitter_block.patch b/sjhbuild/modulesets/patches/gstreamer_system_clock_wait_jitter_block.patch index 754ec89..754ec89 100644 --- a/config/modulesets/patches/gstreamer_system_clock_wait_jitter_block.patch +++ b/sjhbuild/modulesets/patches/gstreamer_system_clock_wait_jitter_block.patch diff --git a/config/modulesets/patches/libabiword-2.5.2-defaultfont.patch b/sjhbuild/modulesets/patches/libabiword-2.5.2-defaultfont.patch index d783f87..d783f87 100644 --- a/config/modulesets/patches/libabiword-2.5.2-defaultfont.patch +++ b/sjhbuild/modulesets/patches/libabiword-2.5.2-defaultfont.patch diff --git a/config/modulesets/patches/libabiword-2.6.0.svn20071031-draghandles.patch b/sjhbuild/modulesets/patches/libabiword-2.6.0.svn20071031-draghandles.patch index 7e47270..7e47270 100644 --- a/config/modulesets/patches/libabiword-2.6.0.svn20071031-draghandles.patch +++ b/sjhbuild/modulesets/patches/libabiword-2.6.0.svn20071031-draghandles.patch diff --git a/config/modulesets/patches/libabiword-2.6.0.svn20071031-nohtmloptions.patch b/sjhbuild/modulesets/patches/libabiword-2.6.0.svn20071031-nohtmloptions.patch index cf885cb..cf885cb 100644 --- a/config/modulesets/patches/libabiword-2.6.0.svn20071031-nohtmloptions.patch +++ b/sjhbuild/modulesets/patches/libabiword-2.6.0.svn20071031-nohtmloptions.patch diff --git a/config/modulesets/patches/libabiword-2.6.0.svn20071106-noassertinput.patch b/sjhbuild/modulesets/patches/libabiword-2.6.0.svn20071106-noassertinput.patch index 1c1bef0..1c1bef0 100644 --- a/config/modulesets/patches/libabiword-2.6.0.svn20071106-noassertinput.patch +++ b/sjhbuild/modulesets/patches/libabiword-2.6.0.svn20071106-noassertinput.patch diff --git a/config/modulesets/patches/libdbus_marshal.patch b/sjhbuild/modulesets/patches/libdbus_marshal.patch index 8fc163e..8fc163e 100644 --- a/config/modulesets/patches/libdbus_marshal.patch +++ b/sjhbuild/modulesets/patches/libdbus_marshal.patch diff --git a/config/modulesets/patches/libjingle_ignore_invalid_sockets.patch b/sjhbuild/modulesets/patches/libjingle_ignore_invalid_sockets.patch index 30af0a5..30af0a5 100644 --- a/config/modulesets/patches/libjingle_ignore_invalid_sockets.patch +++ b/sjhbuild/modulesets/patches/libjingle_ignore_invalid_sockets.patch diff --git a/config/modulesets/patches/libjingle_send_assert.patch b/sjhbuild/modulesets/patches/libjingle_send_assert.patch index 9d3a7d3..9d3a7d3 100644 --- a/config/modulesets/patches/libjingle_send_assert.patch +++ b/sjhbuild/modulesets/patches/libjingle_send_assert.patch diff --git a/config/modulesets/patches/libjingle_tcp_wouldblock.patch b/sjhbuild/modulesets/patches/libjingle_tcp_wouldblock.patch index a89e0a7..a89e0a7 100644 --- a/config/modulesets/patches/libjingle_tcp_wouldblock.patch +++ b/sjhbuild/modulesets/patches/libjingle_tcp_wouldblock.patch diff --git a/config/modulesets/patches/poppler-build.patch b/sjhbuild/modulesets/patches/poppler-build.patch index d0591ea..d0591ea 100644 --- a/config/modulesets/patches/poppler-build.patch +++ b/sjhbuild/modulesets/patches/poppler-build.patch diff --git a/config/modulesets/patches/pygobject-pylint.patch b/sjhbuild/modulesets/patches/pygobject-pylint.patch index 8e4ff97..8e4ff97 100644 --- a/config/modulesets/patches/pygobject-pylint.patch +++ b/sjhbuild/modulesets/patches/pygobject-pylint.patch diff --git a/config/modulesets/patches/telepathy-gabble-chmod-unix-socket.patch b/sjhbuild/modulesets/patches/telepathy-gabble-chmod-unix-socket.patch index bb16883..bb16883 100644 --- a/config/modulesets/patches/telepathy-gabble-chmod-unix-socket.patch +++ b/sjhbuild/modulesets/patches/telepathy-gabble-chmod-unix-socket.patch diff --git a/config/modulesets/patches/telepathy-gabble-olpc-no-dbus-uid-check.patch b/sjhbuild/modulesets/patches/telepathy-gabble-olpc-no-dbus-uid-check.patch index f7e69f0..f7e69f0 100644 --- a/config/modulesets/patches/telepathy-gabble-olpc-no-dbus-uid-check.patch +++ b/sjhbuild/modulesets/patches/telepathy-gabble-olpc-no-dbus-uid-check.patch diff --git a/config/modulesets/patches/telepathy-salut-chmod-unix-socket.patch b/sjhbuild/modulesets/patches/telepathy-salut-chmod-unix-socket.patch index b6ba1b0..b6ba1b0 100644 --- a/config/modulesets/patches/telepathy-salut-chmod-unix-socket.patch +++ b/sjhbuild/modulesets/patches/telepathy-salut-chmod-unix-socket.patch diff --git a/config/modulesets/patches/telepathy-salut-olpc-no-dbus-uid-check.patch b/sjhbuild/modulesets/patches/telepathy-salut-olpc-no-dbus-uid-check.patch index d876cd8..d876cd8 100644 --- a/config/modulesets/patches/telepathy-salut-olpc-no-dbus-uid-check.patch +++ b/sjhbuild/modulesets/patches/telepathy-salut-olpc-no-dbus-uid-check.patch diff --git a/config/modulesets/patches/xulrunner-no-native-theme.patch b/sjhbuild/modulesets/patches/xulrunner-no-native-theme.patch index 85c2fdf..85c2fdf 100644 --- a/config/modulesets/patches/xulrunner-no-native-theme.patch +++ b/sjhbuild/modulesets/patches/xulrunner-no-native-theme.patch diff --git a/config/modulesets/patches/xulrunner-perms.patch b/sjhbuild/modulesets/patches/xulrunner-perms.patch index 524d5aa..524d5aa 100644 --- a/config/modulesets/patches/xulrunner-perms.patch +++ b/sjhbuild/modulesets/patches/xulrunner-perms.patch diff --git a/config/modulesets/patches/xulrunner-xds.patch b/sjhbuild/modulesets/patches/xulrunner-xds.patch index cb7eb28..cb7eb28 100644 --- a/config/modulesets/patches/xulrunner-xds.patch +++ b/sjhbuild/modulesets/patches/xulrunner-xds.patch diff --git a/sjhbuild/modulesets/sugar.modules b/sjhbuild/modulesets/sugar.modules new file mode 100644 index 0000000..cc18300 --- /dev/null +++ b/sjhbuild/modulesets/sugar.modules @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/config/modulesets/tools.modules b/sjhbuild/modulesets/tools.modules index 3600f6b..3600f6b 100644 --- a/config/modulesets/tools.modules +++ b/sjhbuild/modulesets/tools.modules diff --git a/scripts/sysdeps.py b/sjhbuild/sysdeps.py index b398cff..b398cff 100644 --- a/scripts/sysdeps.py +++ b/sjhbuild/sysdeps.py diff --git a/config/sysdeps/debian-unstable.xml b/sjhbuild/sysdeps/debian-unstable.xml index 118a72a..0971c58 100644 --- a/config/sysdeps/debian-unstable.xml +++ b/sjhbuild/sysdeps/debian-unstable.xml @@ -64,6 +64,6 @@ - + diff --git a/config/sysdeps/fedora-10.xml b/sjhbuild/sysdeps/fedora-10.xml index 9335495..190db8c 100644 --- a/config/sysdeps/fedora-10.xml +++ b/sjhbuild/sysdeps/fedora-10.xml @@ -46,7 +46,7 @@ - + - + - + diff --git a/config/sysdeps/ubuntu-8.10.xml b/sjhbuild/sysdeps/ubuntu-8.10.xml index a06f28d..e9e9380 100644 --- a/config/sysdeps/ubuntu-8.10.xml +++ b/sjhbuild/sysdeps/ubuntu-8.10.xml @@ -54,7 +54,7 @@ source="pygobject"/> - + diff --git a/sugar-jhbuild b/sugar-jhbuild index f185923..fc2baac 100755 --- a/sugar-jhbuild +++ b/sugar-jhbuild @@ -5,9 +5,11 @@ import sys import subprocess base_dir = os.path.abspath(os.path.dirname(__file__)) -jhbuild_dir = os.path.join(base_dir, 'jhbuild') -sys.path.append(os.path.join(base_dir, 'scripts')) +sjhbuild_dir = os.path.join(base_dir, 'sjhbuild') +sys.path.append(sjhbuild_dir) + +jhbuild_dir = os.path.join(base_dir, 'jhbuild') sys.path.append(jhbuild_dir) args = sys.argv[1:] @@ -23,6 +25,8 @@ if os.path.exists(jhbuild_dir): cwd = os.getcwd() os.chdir(jhbuild_dir) + print 'Updating jhbuild...' + retcode = subprocess.call(['git', 'pull']) if retcode: print 'Failed to update jhbuild.' @@ -32,7 +36,7 @@ else: cwd = os.getcwd() os.chdir(base_dir) - jhbuild_repo = 'git://dev.laptop.org/users/marco/jhbuild' + jhbuild_repo = 'git://git.gnome.org/jhbuild' retcode = subprocess.call(['git', 'clone', jhbuild_repo]) if retcode: print 'Failed to clone sugar-jhbuild.' @@ -41,4 +45,4 @@ else: import main -sys.exit(main.main(sys.argv[1:])) +sys.exit(main.main(base_dir, sys.argv[1:])) diff --git a/sugar.jhbuildrc b/sugar.jhbuildrc new file mode 100644 index 0000000..de7d3e3 --- /dev/null +++ b/sugar.jhbuildrc @@ -0,0 +1,8 @@ +#moduleset = '/home/buildslave/sugar-jhbuild/config/modulesets/tools.modules' + +modules = ['meta-sugar'] + + +jhbuildbot_master = 'buildbot.sugarlabs.org:9070' +jhbuildbot_slavename = 'Fedora10' +jhbuildbot_password = 'nice' -- cgit v0.9.1