|
Lines 329-339
Link Here
|
| 329 |
(target_root,)) |
329 |
(target_root,)) |
| 330 |
os.system("cd / ; %s -X -r '%s'" % (ldconfig, target_root)) |
330 |
os.system("cd / ; %s -X -r '%s'" % (ldconfig, target_root)) |
| 331 |
elif ostype in ("FreeBSD", "DragonFly"): |
331 |
elif ostype in ("FreeBSD", "DragonFly"): |
| 332 |
writemsg_level(_(">>> Regenerating %svar/run/ld-elf.so.hints...\n") % \ |
332 |
if ostype == "DragonFly" or not os.path.isfile(("%svar/run/ld-elf32.so.hints") % (target_root)): |
| 333 |
target_root) |
333 |
writemsg_level(_(">>> Regenerating %svar/run/ld-elf.so.hints...\n") % \ |
| 334 |
os.system(("cd / ; %s -elf -i " + \ |
334 |
target_root) |
| 335 |
"-f '%svar/run/ld-elf.so.hints' '%setc/ld.so.conf'") % \ |
335 |
os.system(("cd / ; %s -elf -i " + \ |
| 336 |
(ldconfig, target_root, target_root)) |
336 |
"-f '%svar/run/ld-elf.so.hints' '%setc/ld.so.conf'") % \ |
|
|
337 |
(ldconfig, target_root, target_root)) |
| 338 |
else: |
| 339 |
# Multilib FreeBSD setup is detected, regenerate two separate files |
| 340 |
# Assume that /etc/ld.so.conf contains both 32bit and 64bit directories, but 32bit directories end with '/32' or '/lib32', or contains it as part of path |
| 341 |
paths64 = [] |
| 342 |
paths32 = [] |
| 343 |
with open(("%setc/ld.so.conf") % target_root) as ld_so_conf_file: |
| 344 |
ld_so_conf_content = ld_so_conf_file.readlines() |
| 345 |
ld_so_conf_content = [x.strip() for x in ld_so_conf_content] |
| 346 |
for line in ld_so_conf_content: |
| 347 |
if line.startswith("#"): |
| 348 |
continue |
| 349 |
if (line.endswith("/lib32") or line.endswith("/32") |
| 350 |
or "/lib32/" in line or "/32/" in line): |
| 351 |
paths32.append(line) |
| 352 |
else: |
| 353 |
paths64.append(line) |
| 354 |
# TODO: check if adding target_root is necessary here in case of prefix or similar setup |
| 355 |
paths32 = ["'{0}'".format(element) for element in paths32] |
| 356 |
paths64 = ["'{0}'".format(element) for element in paths64] |
| 357 |
writemsg_level(_(">>> Regenerating %svar/run/ld-elf.so.hints...\n") % \ |
| 358 |
target_root) |
| 359 |
os.system(("cd / ; %s -elf -i " + \ |
| 360 |
"-f '%svar/run/ld-elf.so.hints' " + \ |
| 361 |
" ".join(paths64)) % (ldconfig, target_root)) |
| 362 |
writemsg_level(_(">>> Regenerating %svar/run/ld-elf32.so.hints...\n") % \ |
| 363 |
target_root) |
| 364 |
os.system(("cd / ; %s -elf -i " + \ |
| 365 |
"-f '%svar/run/ld-elf32.so.hints' " + \ |
| 366 |
" ".join(paths32)) % (ldconfig, target_root)) |
| 337 |
|
367 |
|
| 338 |
del specials["LDPATH"] |
368 |
del specials["LDPATH"] |
| 339 |
|
369 |
|