avoid importing portage to improve performance (trunk r9470)
authorZac Medico <zmedico@gentoo.org>
Fri, 28 Mar 2008 12:05:56 +0000 (12:05 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 28 Mar 2008 12:05:56 +0000 (12:05 -0000)
svn path=/main/branches/2.1.2/; revision=9555

bin/pkgname

index 4c0dd6c949e7c5e4b318bb1e2400af54de513a45..e34b3268ee1b901246a527eb0e6f5f228df1ca39 100755 (executable)
@@ -5,13 +5,13 @@
 
 import sys, os
 try:
-       import portage
+       from portage_versions import pkgsplit
 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 portage_versions import pkgsplit
 
-a=portage.pkgsplit(sys.argv[1])
+a=pkgsplit(sys.argv[1])
 if a:
        print a[0],a[1],a[2][1:]
        sys.exit(0)