diff options
author | David Farning <dfarning@gmail.com> | 2009-01-22 01:25:57 (GMT) |
---|---|---|
committer | David Farning <dfarning@gmail.com> | 2009-01-22 01:25:57 (GMT) |
commit | 0c3221c9bbfc482279114be2c8016992b62f572d (patch) | |
tree | e5b107379ec88029177ef8b7de258dd5568d8392 /sjhbuild | |
parent | 220b57d90956fe7daf09865da4de48c645350909 (diff) |
add depscheck
Diffstat (limited to 'sjhbuild')
-rw-r--r-- | sjhbuild/depscheck.py | 37 | ||||
-rw-r--r-- | sjhbuild/main.py | 1 |
2 files changed, 38 insertions, 0 deletions
diff --git a/sjhbuild/depscheck.py b/sjhbuild/depscheck.py new file mode 100644 index 0000000..f318404 --- /dev/null +++ b/sjhbuild/depscheck.py @@ -0,0 +1,37 @@ +import sys +from optparse import make_option + +from jhbuild.commands import Command, register_command + +import sysdeps + +class cmd_depscheck(Command): + + name = 'depscheck' + usage_args = '' + + def __init__(self): + Command.__init__(self, [ + make_option('-s', '--script', + action='store_true', dest='script', default=False, + help=_('script friendly output')), + ]) + + def run(self, config, options, args): + deps = sysdeps.get_packages() + if not options.script and not deps: + print 'Dependencies information is missing, skip sanity check.' + return + + missing_deps = [] + for package, source in deps: + if not sysdeps.check_package(package): + missing_deps.append(package) + + if missing_deps: + if not options.script: + print 'Missing packages:' + print ' '.join(missing_deps) + sys.exit(1) + +register_command(cmd_depscheck) diff --git a/sjhbuild/main.py b/sjhbuild/main.py index be988b9..3ee71bb 100644 --- a/sjhbuild/main.py +++ b/sjhbuild/main.py @@ -34,6 +34,7 @@ from jhbuild.utils.cmds import get_output from jhbuild.moduleset import warn_local_modulesets import bundlemodule +import depscheck from config import Config |