From 3c49708bce048c1f277f6a773f24d62700a35bee Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Fri, 15 Mar 2013 13:17:24 +0000 Subject: [PATCH] Always depend on 0compile This avoids needing to use 0launch internally, which makes unit-testing easiler. --- 0release.xml | 23 +++++++++++------------ compile.py | 13 ++++++++----- tests/testrelease.py | 11 ----------- 3 files changed, 19 insertions(+), 28 deletions(-) diff --git a/0release.xml b/0release.xml index 1299b19..b3390c8 100644 --- a/0release.xml +++ b/0release.xml @@ -21,42 +21,41 @@ - - - --build-slave - - - - - + - - - - + + + + + + + + + + diff --git a/compile.py b/compile.py index aa80035..649cf0d 100644 --- a/compile.py +++ b/compile.py @@ -23,7 +23,7 @@ class Compiler: self.config.add_section('builder-host') #self.config.set('builder-host', 'build', '0launch --not-before 0.10 http://0install.net/2007/interfaces/0release.xml --build-slave "$@"') - self.config.set('builder-host', 'build', '0launch --command=build-slave http://0install.net/2007/interfaces/0release.xml "$@"') + self.config.set('builder-host', 'build', '') self.src_impl = support.get_singleton_impl(self.src_feed) if self.src_impl.arch and self.src_impl.arch.endswith('-src'): @@ -69,7 +69,12 @@ class Compiler: if start: support.show_and_run(start, []) try: - support.show_and_run(command, [os.path.basename(self.src_feed_name), archive_file, self.archive_dir_public_url, binary_feed + '.new']) + args = [os.path.basename(self.src_feed_name), archive_file, self.archive_dir_public_url, binary_feed + '.new'] + if not command: + assert target == 'host', 'Missing build command' + support.check_call([sys.executable, sys.argv[0], '--build-slave'] + args) + else: + support.show_and_run(command, args) finally: if stop: support.show_and_run(stop, []) @@ -97,9 +102,7 @@ def build_slave(src_feed, archive_file, archive_dir_public_url, target_feed): try: COMPILE = [os.environ['0COMPILE']] except KeyError: - print >>sys.stdout, ("\n\n*****\n" - "Please update your ~/.config/0install.net/0release/builders.conf file to use --command=build-slave." - "\n*****\n\n") + # (build slave has an old 0release) COMPILE = ['0launch', '--not-before=0.30', 'http://0install.net/2006/interfaces/0compile.xml'] feed = support.load_feed(src_feed) diff --git a/tests/testrelease.py b/tests/testrelease.py index 88ec995..159fba9 100755 --- a/tests/testrelease.py +++ b/tests/testrelease.py @@ -85,17 +85,6 @@ class TestRelease(unittest.TestCase): imp.reload(basedir) assert basedir.xdg_config_home == config_dir - # Register the local 0release/0compile feeds so we can test against those - self.config = load_config() - - iface = self.config.iface_cache.get_interface("http://0install.net/2007/interfaces/0release.xml") - iface.extra_feeds = [model.Feed(release_feed, arch = None, user_override = True)] - writer.save_interface(iface) - - iface = self.config.iface_cache.get_interface("http://0install.net/2006/interfaces/0compile.xml") - iface.extra_feeds = [model.Feed(os.environ["0COMPILE_FEED"], arch = None, user_override = True)] - writer.save_interface(iface) - def tearDown(self): os.chdir(mydir) ro_rmtree(self.tmp) -- 2.11.4.GIT