except ImportError: # earlier versions in '/usr/lib/gentoolkit/pym'
sys.path.append(os.path.join('/usr', 'lib', 'gentoolkit', 'pym'))
import gentoolkit
-import gentoolkit.query
+
+try:
+ import gentoolkit.query # gentoolkit since 0.3.0
+ def find_packages(key):
+ return gentoolkit.query.Query(cat_pkg).find()
+except ImportError: # earlier versions
+ from gentoolkit.helpers import find_packages
__docformat__ = 'restructuredtext'
@returns: True if ebuild exists, False if no ebuild exists
"""
- pkgs = gentoolkit.query.Query(cat_pkg).find()
+ pkgs = find_packages(cat_pkg)
if len(pkgs):
return True
else: