[entropy] use regex to match correct gcc profile file on disk (entropy postinst trigger)
This commit is contained in:
parent
aed97a8ae3
commit
c73bd6bfe9
@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
from entropy.const import etpConst
|
from entropy.const import etpConst
|
||||||
|
|
||||||
@ -9,9 +10,11 @@ def configure_correct_gcc():
|
|||||||
gcc_profile_file = None
|
gcc_profile_file = None
|
||||||
for gcc_target in gcc_targets:
|
for gcc_target in gcc_targets:
|
||||||
gcc_profile_file_pfx = uname_arch + "-pc-linux-gnu-" + gcc_target
|
gcc_profile_file_pfx = uname_arch + "-pc-linux-gnu-" + gcc_target
|
||||||
|
regex = re.compile(gcc_profile_file_pfx + "((.[0-30])?)$")
|
||||||
|
|
||||||
for curdir, subs, files in os.walk(gcc_dir):
|
for curdir, subs, files in os.walk(gcc_dir):
|
||||||
for fname in files:
|
for fname in files:
|
||||||
if fname.startswith(gcc_profile_file_pfx):
|
if regex.match(fname):
|
||||||
gcc_profile_file = os.path.join(curdir, fname)
|
gcc_profile_file = os.path.join(curdir, fname)
|
||||||
break
|
break
|
||||||
break
|
break
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
from entropy.const import etpConst
|
from entropy.const import etpConst
|
||||||
|
|
||||||
@ -9,9 +10,11 @@ def configure_correct_gcc():
|
|||||||
gcc_profile_file = None
|
gcc_profile_file = None
|
||||||
for gcc_target in gcc_targets:
|
for gcc_target in gcc_targets:
|
||||||
gcc_profile_file_pfx = uname_arch + "-pc-linux-gnu-" + gcc_target
|
gcc_profile_file_pfx = uname_arch + "-pc-linux-gnu-" + gcc_target
|
||||||
|
regex = re.compile(gcc_profile_file_pfx + "((.[0-30])?)$")
|
||||||
|
|
||||||
for curdir, subs, files in os.walk(gcc_dir):
|
for curdir, subs, files in os.walk(gcc_dir):
|
||||||
for fname in files:
|
for fname in files:
|
||||||
if fname.startswith(gcc_profile_file_pfx):
|
if regex.match(fname):
|
||||||
gcc_profile_file = os.path.join(curdir, fname)
|
gcc_profile_file = os.path.join(curdir, fname)
|
||||||
break
|
break
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user