From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 21:51:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 034229BA; Sun, 15 Mar 2015 21:51:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3B45C42; Sun, 15 Mar 2015 21:50:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2FLoxoT004248; Sun, 15 Mar 2015 21:50:59 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2FLoxhQ004247; Sun, 15 Mar 2015 21:50:59 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503152150.t2FLoxhQ004247@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 15 Mar 2015 21:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280122 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Mar 2015 21:51:00 -0000 Author: bapt Date: Sun Mar 15 21:50:58 2015 New Revision: 280122 URL: https://svnweb.freebsd.org/changeset/base/280122 Log: 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 Modified: head/share/mk/bsd.links.mk Modified: head/share/mk/bsd.links.mk ============================================================================== --- head/share/mk/bsd.links.mk Sun Mar 15 21:43:43 2015 (r280121) +++ head/share/mk/bsd.links.mk Sun Mar 15 21:50:58 2015 (r280122) @@ -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