Add portage ImportError sys.path insertion.
authorZac Medico <zmedico@gentoo.org>
Mon, 10 Aug 2009 21:47:30 +0000 (21:47 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 10 Aug 2009 21:47:30 +0000 (21:47 -0000)
svn path=/main/trunk/; revision=13979

bin/egencache

index ac0786fa5e59c07841637ca11742f342b6697589..f5c644be9fcf0dc5d877cbe3c9018d7104daad22 100755 (executable)
@@ -22,7 +22,14 @@ except KeyboardInterrupt:
 import logging
 import optparse
 import os
-import portage
+
+try:
+       import portage
+except ImportError:
+       from os import path as osp
+       sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
+       import portage
+
 from _emerge.MetadataRegen import MetadataRegen
 from portage.cache.cache_errors import CacheError, StatCollision
 from portage.util import writemsg_level