diff -r aa918ce6223c distutils2/pysetup --- a/distutils2/pysetup Mon Feb 28 21:42:32 2011 -0500 +++ b/distutils2/pysetup Sat Mar 05 13:28:08 2011 -0500 @@ -1,5 +1,7 @@ #!/usr/bin/env python +import sys + from distutils2.run import main if __name__ == "__main__": - main() + sys.exit(main()) diff -r aa918ce6223c distutils2/run.py --- a/distutils2/run.py Mon Feb 28 21:42:32 2011 -0500 +++ b/distutils2/run.py Sat Mar 05 13:28:08 2011 -0500 @@ -184,23 +184,29 @@ def main(): for v in value: print(' ' + v) else: print(' ' + value.replace('\n', '\n ')) return 0 if options.search is not None: search = options.search.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)) + dist.path)) + is_installed = True - return 0 + if is_installed: + return 0 + else: + print('%s is not installed' % (options.search)) + return 1 if options.graph is not None: name = options.graph dist = get_distribution(name, use_egg_info=True) if dist is None: print('Distribution not found.') else: dists = get_distributions(use_egg_info=True)