diff -r 3a2f1a407820 distutils2/pysetup --- a/distutils2/pysetup Sun Feb 20 00:43:59 2011 +0100 +++ b/distutils2/pysetup Sat Mar 05 14:28:22 2011 -0500 @@ -1,5 +1,6 @@ #!/usr/bin/env python +import sys from distutils2.run import main if __name__ == "__main__": - main() + sys.exit(main()) diff -r 3a2f1a407820 distutils2/run.py --- a/distutils2/run.py Sun Feb 20 00:43:59 2011 +0100 +++ b/distutils2/run.py Sat Mar 05 14:28:22 2011 -0500 @@ -78,26 +78,30 @@ def _graph(dispatcher, args, **kw): else: dists = get_distributions(use_egg_info=True) graph = generate_graph(dists) print(graph.repr_node(dist)) return 0 - def _search(dispatcher, args, **kw): search = args[0].lower() + is_installed = False for dist in get_distributions(use_egg_info=True): name = dist.name.lower() if search in name: print('%s %s at %s' % (dist.name, dist.metadata['version'], - dist.path)) - - return 0 + dist.path)) + is_installed = True + if is_installed: + return 0 + else: + print('%s is not installed' % (args[0])) + return 1 def _metadata(dispatcher, args, **kw): ### XXX Needs to work on any installed package as well from distutils2.dist import Distribution dist = Distribution() dist.parse_config_files() metadata = dist.metadata