From owner-svn-ports-all@freebsd.org Mon Feb 13 21:48:13 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE349CDE4F9; Mon, 13 Feb 2017 21:48:13 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7DDAF1D3C; Mon, 13 Feb 2017 21:48:13 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1DLmCHA066714; Mon, 13 Feb 2017 21:48:12 GMT (envelope-from rene@FreeBSD.org) Received: (from rene@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1DLmCT9066713; Mon, 13 Feb 2017 21:48:12 GMT (envelope-from rene@FreeBSD.org) Message-Id: <201702132148.v1DLmCT9066713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rene set sender to rene@FreeBSD.org using -f From: Rene Ladan Date: Mon, 13 Feb 2017 21:48:12 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r434056 - head/Mk/Uses X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 21:48:13 -0000 Author: rene Date: Mon Feb 13 21:48:12 2017 New Revision: 434056 URL: https://svnweb.freebsd.org/changeset/ports/434056 Log: Automatically generate @dir entries for package list if :debug is used. Tested with a modified sysutils/biosfont in which the :debug option was added, a file was installed into ${KERN_DEBUGDIR}/${KMODDIR} and that file was added to pkg-plist. PR: 216879 (inspired by) Submitted by: Sergey Kozlov (kozlov.sergey.404@gmail.com) Modified: head/Mk/Uses/kmod.mk Modified: head/Mk/Uses/kmod.mk ============================================================================== --- head/Mk/Uses/kmod.mk Mon Feb 13 21:28:45 2017 (r434055) +++ head/Mk/Uses/kmod.mk Mon Feb 13 21:48:12 2017 (r434056) @@ -33,6 +33,25 @@ KMODDIR?= /boot/modules .if ${KMODDIR} == /boot/kernel KMODDIR= /boot/modules .endif + +_DEBUG_KMOD_SH= \ +${ECHO_CMD} -n "\"@dir /%%KERN_DEBUGDIR%%/%%KMODDIR%%\"" ; \ +skd=`${ECHO_CMD} ${KMODDIR} | ${SED} "s,/, ,g"` ; \ +l=`${ECHO_CMD} $$skd | wc -w` ; \ +while [ $$l -gt 0 ] ; do \ + c=0 ; \ + r="" ; \ + for p in $$skd ; do \ + c=$$(($$c+1)) ; \ + if [ $$c -eq $$l ] ; then \ + break ; \ + fi ; \ + r="$$r/$$p" ; \ + done ; \ + ${ECHO_CMD} -n " \"@dir /%%KERN_DEBUGDIR%%$$r\"" ; \ + l=$$(($$l-1)) ; \ +done + PLIST_SUB+= KMODDIR="${KMODDIR:C,^/,,}" MAKE_ENV+= KMODDIR="${KMODDIR}" SYSDIR="${SRC_BASE}/sys" NO_XREF=yes PLIST_FILES+= "@kld ${KMODDIR}" @@ -42,8 +61,8 @@ STRIP_CMD+= --strip-debug # do not strip KERN_DEBUGDIR?= ${DEBUGDIR} PLIST_SUB+= KERN_DEBUGDIR="${KERN_DEBUGDIR:C,^/,,}" MAKE_ENV+= KERN_DEBUGDIR="${KERN_DEBUGDIR}" -#XXX (rene): it would be nice to automatically add @dir entries here, -# they are somehow needed according to 'make makeplist' +_KMOD_DIRS!= ${_DEBUG_KMOD_SH} +PLIST_FILES+= ${_KMOD_DIRS} .endif .endif