Add encoding informations.
[gentoolkit.git] / pym / gentoolkit / eshowkw / __init__.py
index 8a89a9c961bb42ea03563ab9d0188c5fbb19d2ba..3e3572ee7e62c17fe7c3c4022a99c3aaaeb27fde 100644 (file)
@@ -1,3 +1,4 @@
+#      vim:fileencoding=utf-8
 # Copyright 2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
@@ -93,6 +94,12 @@ def main(argv):
        prefix = opts.prefix
        color = opts.color
        package = opts.package
+
+       # equery support
+       if argv[0] == 'equery' and len(package) <= 0:
+               msg_err = 'No packages specified'
+               raise SystemExit(msg_err)
+
        # disable colors when redirected and they are not forced on
        if not color and not sys.stdout.isatty():
                # disable colors
@@ -108,7 +115,7 @@ def main(argv):
                package=os.path.basename(currdir)
                # check if there are actualy some ebuilds
                ebuilds = ['%s' % x for x in os.listdir(currdir)
-                       if fnmatch.fnmatch(file, '*.ebuild')]
+                       if fnmatch.fnmatch(x, '*.ebuild')]
                if len(ebuilds) <= 0:
                        msg_err = 'No ebuilds at "%s"' % currdir
                        raise SystemExit(msg_err)