From: Karel Zak Date: Fri, 3 Jul 2009 23:10:15 +0000 (+0200) Subject: build-sys: improve symlinks creation in shlibs/ X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15fe69251862d880c6103d9c1646ccae7201dd60;p=util-linux 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 --- 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: