Fix gcc version parsing once again for bug #137786. sigh. :)
authorZac Medico <zmedico@gentoo.org>
Sun, 22 Oct 2006 10:38:16 +0000 (10:38 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 22 Oct 2006 10:38:16 +0000 (10:38 -0000)
svn path=/main/trunk/; revision=4794

bin/emerge

index 86a26b7f24c3b610f96d754e5844b977d010179b..72ba71ef3b9c993a3e07af661332ac016785bd8c 100755 (executable)
@@ -297,8 +297,8 @@ def getgccversion(chost):
                        return myoutput.replace(chost + "-", gcc_ver_prefix, 1)
 
        mystatus, myoutput = commands.getstatusoutput("gcc-config -c")
-       if mystatus == os.EX_OK and len(myoutput.split("-")) > 0:
-               return gcc_ver_prefix + myoutput.split("-")[-1]
+       if mystatus == os.EX_OK and myoutput.startswith(chost + "-"):
+               return myoutput.replace(chost + "-", gcc_ver_prefix, 1)
 
        mystatus, myoutput = commands.getstatusoutput(
                chost + "-" + gcc_ver_command)