@@ -26,27 +26,28 @@ def print_epkginfo_help():
2626 print_help (with_usage = False )
2727
2828
29- equery .initialize_configuration ()
30- args = sys .argv [1 :]
31- if not args or {'-h' , '--help' }.intersection (args ):
32- print_epkginfo_help ()
33- else :
34- try :
35- main (args )
36- except AmbiguousPackageName as e :
37- pkgs = e .args [0 ]
38- for candidate in pkgs :
39- print (candidate )
40-
41- from gentoolkit import pprinter as pp
42- from os .path import basename # To get the short name
43-
44- print (file = sys .stderr )
45- print (pp .error ("The short ebuild name '%s' is ambiguous. Please specify" % basename (pkgs [0 ])),
46- file = sys .stderr , end = "" )
47- pp .die (1 , "one of the above fully-qualified ebuild names instead." )
48- except errors .GentoolkitException as err :
49- from gentoolkit import pprinter as pp
50- pp .die (1 , str (err ))
29+ if __name__ == "__main__" :
30+ equery .initialize_configuration ()
31+ args = sys .argv [1 :]
32+ if not args or {'-h' , '--help' }.intersection (args ):
33+ print_epkginfo_help ()
34+ else :
35+ try :
36+ main (args )
37+ except AmbiguousPackageName as e :
38+ pkgs = e .args [0 ]
39+ for candidate in pkgs :
40+ print (candidate )
41+
42+ from gentoolkit import pprinter as pp
43+ from os .path import basename # To get the short name
44+
45+ print (file = sys .stderr )
46+ print (pp .error ("The short ebuild name '%s' is ambiguous. Please specify" % basename (pkgs [0 ])),
47+ file = sys .stderr , end = "" )
48+ pp .die (1 , "one of the above fully-qualified ebuild names instead." )
49+ except errors .GentoolkitException as err :
50+ from gentoolkit import pprinter as pp
51+ pp .die (1 , str (err ))
5152
5253# vim: set ts=4 sw=4 tw=79:
0 commit comments