[repo] update sys-devel/base-gcc gcc-profile trigger to work with hardened GCC profiles

This commit is contained in:
Fabio Erculiani 2012-03-22 22:46:50 +01:00
parent eddfe0a787
commit 33e27bf1b7
2 changed files with 16 additions and 4 deletions

View File

@ -12,13 +12,19 @@ def configure_correct_gcc():
for curdir, subs, files in os.walk(gcc_dir):
for fname in files:
if fname.startswith(gcc_profile_file_pfx):
gcc_profile_file = fname
gcc_profile_file = os.path.join(curdir, fname)
break
break
if gcc_profile_file is not None:
break
if gcc_profile_file is not None:
subprocess.call(("gcc-config", gcc_profile_file))
# if we're hardened, we want the vanilla one by default
# to avoid stressing the user too much
vanilla_profile_file = gcc_profile_file + "-vanilla"
if os.path.isfile(vanilla_profile_file):
gcc_profile_file = vanilla_profile_file
profile_name = os.path.basename(gcc_profile_file)
subprocess.call(("gcc-config", profile_name))
if stage == "postinstall":
configure_correct_gcc()

View File

@ -12,13 +12,19 @@ def configure_correct_gcc():
for curdir, subs, files in os.walk(gcc_dir):
for fname in files:
if fname.startswith(gcc_profile_file_pfx):
gcc_profile_file = fname
gcc_profile_file = os.path.join(curdir, fname)
break
break
if gcc_profile_file is not None:
break
if gcc_profile_file is not None:
subprocess.call(("gcc-config", gcc_profile_file))
# if we're hardened, we want the vanilla one by default
# to avoid stressing the user too much
vanilla_profile_file = gcc_profile_file + "-vanilla"
if os.path.isfile(vanilla_profile_file):
gcc_profile_file = vanilla_profile_file
profile_name = os.path.basename(gcc_profile_file)
subprocess.call(("gcc-config", profile_name))
if stage == "postinstall":
configure_correct_gcc()