keep LD_LIBRARY_PATH order

from YouDirk's and donnerbrenn's fix at
e1d747c975

this code still removes duplicate entries, though
This commit is contained in:
PoroCYon 2021-01-17 17:07:47 +01:00
parent e37a0d8e50
commit 63afc83c4d
1 changed files with 7 additions and 2 deletions

View File

@ -149,11 +149,16 @@ def get_needed_syms(readelf_bin, inpfile) -> Dict[str, str]: # (symname, relocty
return syms#, needgot return syms#, needgot
def uniq_list(l):
od = OrderedDict()
for x in l: od[x] = x
return list(od.keys())
def format_cc_path_line(entry): def format_cc_path_line(entry):
category, path = entry.split(': ', 1) category, path = entry.split(': ', 1)
path = path.lstrip('=') path = path.lstrip('=')
return (category, list(set(os.path.realpath(p) \ return (category, uniq_list(os.path.realpath(p) \
for p in path.split(':') if os.path.isdir(p)))) for p in path.split(':') if os.path.isdir(p))[::-1])
def get_cc_paths(cc_bin): def get_cc_paths(cc_bin):