meson/megadriver: replace hardlinks with symlinks

The wording in the script has always (3218056e0e) been about symlinks,
and it feels like the use of `link()` instead of `symlink()` was
a typo that became fact.

These hardlinks make packaging harder (many distros have some variant of
this patch locally) especially when it comes to debug packages where gdb
expects the symbols file to have the same name as the lib the symbols
come from, and I don't think they make anything better, so let's change
to code to match the documentation :)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29731>
This commit is contained in:
Eric Engestrom
2024-05-29 12:23:47 +02:00
committed by Marge Bot
parent ac5d14c5ea
commit d5ec3a8988
2 changed files with 5 additions and 5 deletions

View File

@@ -42,7 +42,8 @@ def main():
else:
to = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], args.libdir)
master = os.path.join(to, os.path.basename(args.megadriver))
basename = os.path.basename(args.megadriver)
master = os.path.join(to, basename)
if not os.path.exists(to):
if os.path.lexists(to):
@@ -54,8 +55,8 @@ def main():
if os.path.lexists(abs_driver):
os.unlink(abs_driver)
print(f'Installing hardlink to {args.megadriver} to {abs_driver}')
os.link(master, abs_driver)
print(f'Installing symlink pointing to {basename} to {abs_driver}')
os.symlink(basename, abs_driver)
try:
ret = os.getcwd()