From 15fe69251862d880c6103d9c1646ccae7201dd60 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Sat, 4 Jul 2009 01:10:15 +0200 Subject: [PATCH] build-sys: improve symlinks creation in shlibs/ It's more safe to create symlinks in the target directory and use $(LN_S) rather than directly call "ln -sf". Reported-by: Peter Breitenlohner Signed-off-by: Karel Zak --- shlibs/blkid/src/Makefile.am | 4 +++- shlibs/uuid/src/Makefile.am | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/shlibs/blkid/src/Makefile.am b/shlibs/blkid/src/Makefile.am index 96e12fd2..8129d28c 100644 --- a/shlibs/blkid/src/Makefile.am +++ b/shlibs/blkid/src/Makefile.am @@ -56,7 +56,9 @@ install-exec-hook: mv $(DESTDIR)$(usrlibexecdir)/libblkid.so.* $(DESTDIR)$(libdir); \ so_img_name=$$(readlink $(DESTDIR)$(usrlibexecdir)/libblkid.so); \ so_img_rel_target=$$(echo $(usrlibexecdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \ - ln -sf $$so_img_rel_target$(libdir)/$$so_img_name $(DESTDIR)$(usrlibexecdir)/libblkid.so; \ + (cd $(DESTDIR)$(usrlibexecdir) && \ + rm -f libblkid.so && \ + $(LN_S) $$so_img_rel_target$(libdir)/$$so_img_name libblkid.so); \ fi uninstall-hook: diff --git a/shlibs/uuid/src/Makefile.am b/shlibs/uuid/src/Makefile.am index 264e6adc..81aa1865 100644 --- a/shlibs/uuid/src/Makefile.am +++ b/shlibs/uuid/src/Makefile.am @@ -37,7 +37,9 @@ install-exec-hook: mv $(DESTDIR)$(usrlibexecdir)/libuuid.so.* $(DESTDIR)$(libdir); \ so_img_name=$$(readlink $(DESTDIR)$(usrlibexecdir)/libuuid.so); \ so_img_rel_target=$$(echo $(usrlibexecdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \ - ln -sf $$so_img_rel_target$(libdir)/$$so_img_name $(DESTDIR)$(usrlibexecdir)/libuuid.so; \ + (cd $(DESTDIR)$(usrlibexecdir) && \ + rm -f libuuid.so && \ + $(LN_S) $$so_img_rel_target$(libdir)/$$so_img_name libuuid.so); \ fi uninstall-hook: -- 2.39.5