[entropy] update sys-devel/base-gcc trigger to detect GCC 4.8, 4.7, 4.6

This commit is contained in:
Fabio Erculiani 2011-11-23 08:04:23 +01:00
parent eb4020b644
commit ef5e2427ce

View File

@ -3,17 +3,20 @@ import subprocess
from entropy.const import etpConst from entropy.const import etpConst
def configure_correct_gcc(): def configure_correct_gcc():
gcc_target = "4.6" gcc_targets = ["4.8", "4.7", "4.6"]
uname_arch = os.uname()[4] uname_arch = os.uname()[4]
gcc_dir = etpConst['systemroot'] + "/etc/env.d/gcc" gcc_dir = etpConst['systemroot'] + "/etc/env.d/gcc"
gcc_profile_file_pfx = uname_arch + "-pc-linux-gnu-" + gcc_target
gcc_profile_file = None gcc_profile_file = None
for curdir, subs, files in os.walk(gcc_dir): for gcc_target in gcc_targets:
for fname in files: gcc_profile_file_pfx = uname_arch + "-pc-linux-gnu-" + gcc_target
if fname.startswith(gcc_profile_file_pfx): for curdir, subs, files in os.walk(gcc_dir):
gcc_profile_file = fname for fname in files:
break if fname.startswith(gcc_profile_file_pfx):
break gcc_profile_file = fname
break
break
if gcc_profile_file is not None:
break
if gcc_profile_file is not None: if gcc_profile_file is not None:
subprocess.call(("gcc-config", gcc_profile_file)) subprocess.call(("gcc-config", gcc_profile_file))