diff options
author | bapt <bapt@FreeBSD.org> | 2015-03-15 21:50:58 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2015-03-15 21:50:58 +0000 |
commit | c9957237a00d22395f192428026dc17f801e746c (patch) | |
tree | 080bd86aa6108f3419953e4c74f86a189bb3f12a /share/mk/bsd.links.mk | |
parent | cad4d97aa8cf8bb6c9c1c851afb3c7c5e3dcc42e (diff) | |
download | FreeBSD-src-c9957237a00d22395f192428026dc17f801e746c.zip FreeBSD-src-c9957237a00d22395f192428026dc17f801e746c.tar.gz |
Symplify links installation by using multi variable for loop
Using multi variable for loop not only simplify the code, it also ensures that
the LINKS and SYMLINKS input have the right number of words
Differential Revision: https://reviews.freebsd.org/D2069
Reviewed by: imp
Diffstat (limited to 'share/mk/bsd.links.mk')
-rw-r--r-- | share/mk/bsd.links.mk | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/share/mk/bsd.links.mk b/share/mk/bsd.links.mk index 1e4d57e..e182a19 100644 --- a/share/mk/bsd.links.mk +++ b/share/mk/bsd.links.mk @@ -7,25 +7,11 @@ afterinstall: _installlinks .ORDER: realinstall _installlinks _installlinks: -.if defined(LINKS) && !empty(LINKS) - @set ${LINKS}; \ - while test $$# -ge 2; do \ - l=${DESTDIR}$$1; \ - shift; \ - t=${DESTDIR}$$1; \ - shift; \ - ${ECHO} $$t -\> $$l; \ - ${INSTALL_LINK} $$l $$t; \ - done; true -.endif -.if defined(SYMLINKS) && !empty(SYMLINKS) - @set ${SYMLINKS}; \ - while test $$# -ge 2; do \ - l=$$1; \ - shift; \ - t=${DESTDIR}$$1; \ - shift; \ - ${ECHO} $$t -\> $$l; \ - ${INSTALL_SYMLINK} $$l $$t; \ - done; true -.endif +.for s t in ${LINKS} + @${ECHO} "$t -> $s" ;\ + ${INSTALL_LINK} $s $t +.endfor +.for s t in ${SYMLINKS} + @${ECHO} "$t -> $s" ;\ + ${INSTALL_SYMLINK} $s $t +.endfor |