diff mbox

[iptables] build: add DESTDIR to vx_bin_links

Message ID 1378503540-16134-1-git-send-email-ljlane@debian.org
State Not Applicable
Headers show

Commit Message

Laurence J. Lane Sept. 6, 2013, 9:39 p.m. UTC
Fixes dangling symlinks when using DESTDIR.

Signed-off-by: Laurence J. Lane <ljlane@debian.org>
---
 iptables/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Engelhardt Sept. 7, 2013, 12:49 a.m. UTC | #1
On Friday 2013-09-06 23:39, Laurence J. Lane wrote:

>Fixes dangling symlinks when using DESTDIR.
>
>Signed-off-by: Laurence J. Lane <ljlane@debian.org>
>-	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
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Laurence J. Lane Sept. 7, 2013, 2:14 a.m. UTC | #2
You're right. Withdrawn.

On Fri, Sep 6, 2013 at 8:49 PM, Jan Engelhardt <jengelh@inai.de> wrote:
>
> On Friday 2013-09-06 23:39, Laurence J. Lane wrote:
>
>>Fixes dangling symlinks when using DESTDIR.
>>
>>Signed-off-by: Laurence J. Lane <ljlane@debian.org>
>>-      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!
>
>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Maciej Żenczykowski Sept. 8, 2013, 6:41 a.m. UTC | #3
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...

On Fri, Sep 6, 2013 at 7:14 PM, Laurence J. Lane <ljlane@debian.org> wrote:
> You're right. Withdrawn.
>
> On Fri, Sep 6, 2013 at 8:49 PM, Jan Engelhardt <jengelh@inai.de> wrote:
>>
>> On Friday 2013-09-06 23:39, Laurence J. Lane wrote:
>>
>>>Fixes dangling symlinks when using DESTDIR.
>>>
>>>Signed-off-by: Laurence J. Lane <ljlane@debian.org>
>>>-      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!
>>
>>
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/iptables/Makefile.am b/iptables/Makefile.am
index a4246eb..ec53443 100644
--- a/iptables/Makefile.am
+++ b/iptables/Makefile.am
@@ -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;