Merge branch 'gentoolkit' of git+ssh://git.overlays.gentoo.org/proj/gentoolkit into...
[gentoolkit.git] / pym / gentoolkit / revdep_rebuild / rebuild.py
index 5f644730c17ba3f568f1aebb3746eb9cc78e37a5..abbf72dd5e22777023ce289c740f9aa0efda3d34 100644 (file)
@@ -56,9 +56,9 @@ def print_usage():
   -h, --help            Print this usage
   -i, --ignore          Ignore temporary files from previous runs
                         (also won't create any)
-  -L, --library NAME    Emerge existing packages that use
-                        the library with NAME
-       --library=NAME   NAME can be a full or partial library name
+  -L, --library NAME    Unconditionally emerge existing packages that use
+      --library=NAME    the library with NAME. NAME can be a full or partial
+                        library name
   -l, --no-ld-path      Do not set LD_LIBRARY_PATH
   -o, --no-order        Do not check the build order
                         (Saves time, but may cause breakage.)
@@ -103,10 +103,10 @@ def parse_options():
                        'keep-temp', 'library=', 'no-ld-path', 'no-order',
                        'pretend', 'no-pretend', 'no-progress', 'quiet', 'verbose'])
 
+               do_help = False
                for key, val in opts:
                        if key in ('-h', '--help'):
-                               print_usage()
-                               sys.exit(0)
+                               do_help = True
                        elif key in ('-q', '--quiet'):
                                settings['quiet'] = True
                                settings['VERBOSITY'] = 0
@@ -134,6 +134,9 @@ def parse_options():
                print(red('Unrecognized option\n'))
                print_usage()
                sys.exit(2)
+       if do_help:
+               print_usage()
+               sys.exit(0)
        return settings
 
 
@@ -192,19 +195,22 @@ def main(settings=None, logger=None):
        if not settings['stdout'].isatty() or settings['nocolor']:
                nocolor()
 
+       #TODO: Development warning
+       logger.warn(blue(' * ') + 
+               yellow('This is a development version, '
+                       'so it may not work correctly'))
+       logger.warn(blue(' * ') + 
+               yellow('The original revdep-rebuild script is '
+                       'installed as revdep-rebuild.sh'))
+
        if os.getuid() != 0 and not settings['PRETEND']:
                logger.warn(blue(' * ') + 
                        yellow('You are not root, adding --pretend to portage options'))
                settings['PRETEND'] = True
-       elif not settings['PRETEND'] \
-                       and settings['IS_DEV'] \
-                       and not settings['NO_PRETEND']:
-               logger.warn(blue(' * ') + 
-                       yellow('This is a development version, '
-                               'so it may not work correctly'))
-               logger.warn(blue(' * ') + 
-                       yellow('The original revdep-rebuild script is '
-                               'installed as revdep-rebuild.sh'))
+
+       if settings['library']:
+               logger.warn(green(' * ') + 
+                       "Looking for libraries: %s" % (bold(', '.join(settings['library']))))
 
        if settings['USE_TMP_FILES'] \
                        and check_temp_files(settings['DEFAULT_TMP_DIR'], logger=logger):