emerge --info: show linker version, bug #436294 v2.2.0_alpha142
authorZac Medico <zmedico@gentoo.org>
Fri, 26 Oct 2012 17:45:54 +0000 (10:45 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 26 Oct 2012 17:45:54 +0000 (10:45 -0700)
pym/_emerge/actions.py

index fec2dfa55a80342aab159cad3c0a1bf2df5bfaa1..2b3e57e62f1c4675a0069a9bf3250238e22c73db 100644 (file)
@@ -1361,6 +1361,7 @@ def action_info(settings, trees, myopts, myfiles):
        append = output_buffer.append
        root_config = trees[settings['EROOT']]['root_config']
        running_eroot = trees._running_eroot
+       chost = settings.get("CHOST")
 
        append(getportageversion(settings["PORTDIR"], None,
                settings.profile_path, settings["CHOST"],
@@ -1382,6 +1383,23 @@ def action_info(settings, trees, myopts, myfiles):
                lastSync = "Unknown"
        append("Timestamp of tree: %s" % (lastSync,))
 
+       ld_names = []
+       if chost:
+               ld_names.append(chost + "-ld")
+       ld_names.append("ld")
+       for name in ld_names:
+               try:
+                       proc = subprocess.Popen([name, "--version"],
+                               stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+               except OSError:
+                       pass
+               else:
+                       output = _unicode_decode(proc.communicate()[0]).splitlines()
+                       proc.wait()
+                       if proc.wait() == os.EX_OK and output:
+                               append("ld %s" % (output[0]))
+                               break
+
        try:
                proc = subprocess.Popen(["distcc", "--version"],
                        stdout=subprocess.PIPE, stderr=subprocess.STDOUT)