Skip to contentSkip to conversation

build: add DESTDIR to vx_bin_links

PATCH In review Laurence J. Lane 3 participants 4 messages Sep 6, 2013 – Sep 8, 2013 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: add DESTDIR to vx_bin_links

Fixes dangling symlinks when using DESTDIR.

---
 iptables/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
iptables/Makefile.am +1 -1
index a4246eb..ec53443 100644
@@ -49,6 +49,6 @@ pkgconfig_DATA = xtables.pc
 install-exec-hook:
 	-if test -z "${DESTDIR}"; then /sbin/ldconfig; fi;
 	${INSTALL} -dm0755 "${DESTDIR}${bindir}";
-	for i in ${vx_bin_links}; do ${LN_S} -f "${sbindir}/xtables-multi" "${DESTDIR}${bindir}/$$i"; done;
+	for i in ${vx_bin_links}; do ${LN_S} -f "${DESTDIR}${sbindir}/xtables-multi" "${DESTDIR}${bindir}/$$i"; done;
 	for i in ${v4_sbin_links}; do ${LN_S} -f xtables-multi "${DESTDIR}${sbindir}/$$i"; done;
 	for i in ${v6_sbin_links}; do ${LN_S} -f xtables-multi "${DESTDIR}${sbindir}/$$i"; done;
Signature · 1 line
1.8.4.rc3
#1 lore raw

Review

Quoted 7 lines · Laurence J. Lane

Fixes dangling symlinks when using DESTDIR.

(quoted diff) +1 -1
-	for i in ${vx_bin_links}; do ${LN_S} -f \
          "${sbindir}/xtables-multi" "${DESTDIR}${bindir}/$$i"; done;
+	for i in ${vx_bin_links}; do ${LN_S} -f \
          "${DESTDIR}${sbindir}/xtables-multi" "${DESTDIR}${bindir}/$$i"; done;

This seems totally incorrect. By including DESTDIR in the symlink target, you are *creating* a dangling symlink. RPM, DEB (and whatever other packages) would suddenly contain a file that goes like

 $ rpm -ql iptables
 lrwxrwxrwx 1 root root 13 Jan 27 2013 /usr/sbin/iptables ->
   /home/abuild/rpmbuild/BUILDROOT/iptables-1.4.20/usr/bin/xtables-multi
#2 lore raw

You're right. Withdrawn.

Quoted 22 lines · Jan Engelhardt

Review

Quoted 7 lines · Laurence J. Lane

Fixes dangling symlinks when using DESTDIR.

(quoted diff) +1 -1
-      for i in ${vx_bin_links}; do ${LN_S} -f \
          "${sbindir}/xtables-multi" "${DESTDIR}${bindir}/$$i"; done;
+      for i in ${vx_bin_links}; do ${LN_S} -f \
          "${DESTDIR}${sbindir}/xtables-multi" "${DESTDIR}${bindir}/$$i"; done;

This seems totally incorrect. By including DESTDIR in the symlink target, you are *creating* a dangling symlink. RPM, DEB (and whatever other packages) would suddenly contain a file that goes like

 $ rpm -ql iptables
 lrwxrwxrwx 1 root root 13 Jan 27 2013 /usr/sbin/iptables ->
   /home/abuild/rpmbuild/BUILDROOT/iptables-1.4.20/usr/bin/xtables-multi

!DSPAM:522a78438821787114786!

#3 lore raw

It should probably be a relative link, but that's probably hard to do seeing as we don't know how many levels up you need to go...

Quoted 29 lines · Laurence J. Lane

You're right. Withdrawn.

Quoted 15 lines · Jan Engelhardt

Review

Quoted 7 lines · Laurence J. Lane

Fixes dangling symlinks when using DESTDIR.

(quoted diff) +1 -1
-      for i in ${vx_bin_links}; do ${LN_S} -f \
          "${sbindir}/xtables-multi" "${DESTDIR}${bindir}/$$i"; done;
+      for i in ${vx_bin_links}; do ${LN_S} -f \
          "${DESTDIR}${sbindir}/xtables-multi" "${DESTDIR}${bindir}/$$i"; done;

This seems totally incorrect. By including DESTDIR in the symlink target, you are *creating* a dangling symlink. RPM, DEB (and whatever other packages) would suddenly contain a file that goes like

Quoted 7 lines
 $ rpm -ql iptables
 lrwxrwxrwx 1 root root 13 Jan 27 2013 /usr/sbin/iptables ->
   /home/abuild/rpmbuild/BUILDROOT/iptables-1.4.20/usr/bin/xtables-multi

!DSPAM:522a78438821787114786!

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html