Fix getgccversion() logic so that it works properly with eselect compiler for bug...
authorZac Medico <zmedico@gentoo.org>
Tue, 6 Jun 2006 04:10:33 +0000 (04:10 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 6 Jun 2006 04:10:33 +0000 (04:10 -0000)
svn path=/main/trunk/; revision=3463

bin/emerge

index 40f1ae56b839882651efa0f757ef4c64436aecd4..0eae18a67422e0aa93f00d104a4cbdc93b9584e9 100755 (executable)
@@ -535,11 +535,13 @@ def getgccversion():
        "!!! other terminals also.\n"
        )
 
-       mystatus, myoutput = commands.getstatusoutput("gcc-config -c")
-       if mystatus == os.EX_OK and len(myoutput.split("-")) > 0:
-               return gcc_ver_prefix + myoutput.split("-")[-1]
-
        mystatus, myoutput = commands.getstatusoutput("eselect compiler show")
+       if mystatus == os.EX_OK and len(myoutput.split("/")) == 2:
+               part1, part2 = myoutput.split("/")
+               if len(part1.split("-")) > 0:
+                       return gcc_ver_prefix + part1.split("-")[-1] + "/" + part2
+
+       mystatus, myoutput = commands.getstatusoutput("gcc-config -c")
        if mystatus == os.EX_OK and len(myoutput.split("-")) > 0:
                return gcc_ver_prefix + myoutput.split("-")[-1]