diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-01-26 13:48:48 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-01-26 13:48:48 (GMT) |
commit | a5a9c0fb4f20eaae3c43b586170a805cf42567de (patch) | |
tree | f6631bd76ae88a7a1db6b9543faec7bc68cc61e7 | |
parent | 2113414727f25a1b48e37478ef326733894227e8 (diff) |
Automatically sanitycheck on a full build.
Give feedback on sanitycheck when it succeed.
-rw-r--r-- | sanitycheck.py | 37 | ||||
-rwxr-xr-x | sugar-jhbuild | 8 |
2 files changed, 28 insertions, 17 deletions
diff --git a/sanitycheck.py b/sanitycheck.py index 6379363..f2594c9 100644 --- a/sanitycheck.py +++ b/sanitycheck.py @@ -1,4 +1,5 @@ import os +import sys import re from jhbuild.commands import Command, register_command @@ -98,26 +99,23 @@ class DependencyChecker: def get_missing(self): return self._missing + def has_missing(self): + return len(self._missing) > 0 + class cmd_sanitycheck(Command): name = 'sanitycheck' usage_args = '' def run(self, config, options, args): - checker = DependencyChecker() + ext_checker = DependencyChecker() - checker.check_automake('1.9') - checker.check_libtool('1.5') - checker.check_intltool('0.35.0') - checker.check_library('gstreamer-0.10', '0.10') - checker.check_library('gstreamer-plugins-base-0.10', '0.10') - checker.check_library('x11') - - if len(checker.get_missing()) > 0: - print 'Missing external dependencies:\n' - for missing in checker.get_missing(): - print missing - print '\n%s' % (_install_packages_msg) + ext_checker.check_automake('1.9') + ext_checker.check_libtool('1.5') + ext_checker.check_intltool('0.35.0') + ext_checker.check_library('gstreamer-0.10', '0.10') + ext_checker.check_library('gstreamer-plugins-base-0.10', '0.10') + ext_checker.check_library('x11') checker = DependencyChecker() @@ -131,10 +129,21 @@ class cmd_sanitycheck(Command): sdk_path = os.path.join(config.prefix, 'lib', config.xulrunner_sdk) checker.check_gecko(sdk_path) - if len(checker.get_missing()) > 0: + if ext_checker.has_missing(): + print 'Missing external dependencies:\n' + for missing in ext_checker.get_missing(): + print missing + print '\n%s' % (_install_packages_msg) + + if checker.has_missing(): print 'Missing dependencies:\n' for missing in checker.get_missing(): print ' %s' % missing print '\n%s\n%s' % (_install_packages_msg, _build_dependencies_msg) + if checker.has_missing() or ext_checker.has_missing(): + sys.exit(1) + else: + print "Dependencies check succeeded." + register_command(cmd_sanitycheck) diff --git a/sugar-jhbuild b/sugar-jhbuild index 45a74ed..ad084e3 100755 --- a/sugar-jhbuild +++ b/sugar-jhbuild @@ -25,11 +25,13 @@ if len(sys.argv) > 0: if len(sys.argv) > 1: args = sys.argv[2:] -if command == 'build-base': +if command == 'build': + print 'Checking dependencies...' + jhbuild.commands.run('sanitycheck', config, []) +elif command == 'build-base': command = 'build' args.append('meta-sugar-base') - -if command == 'run' and len(args) == 0: +elif command == 'run' and len(args) == 0: args.append('sugar-emulator') jhbuild.commands.run(command, config, args) |