]> err.no Git - util-linux/commitdiff
build-sys: improve symlinks creation in shlibs/
authorKarel Zak <kzak@redhat.com>
Fri, 3 Jul 2009 23:10:15 +0000 (01:10 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 3 Jul 2009 23:10:15 +0000 (01:10 +0200)
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 <peb@mppmu.mpg.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/Makefile.am
shlibs/uuid/src/Makefile.am

index 96e12fd29c2ad5dc818016778377e64f41f3cf27..8129d28c2951ae0f6cb1b98d363b46c65458b505 100644 (file)
@@ -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:
index 264e6adc88657f9ab689ec18f243b204f2d630ad..81aa1865009bc5d29ca2e3e50f3bca9028d502c8 100644 (file)
@@ -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: