From owner-svn-ports-all@FreeBSD.ORG Tue Apr 22 23:28:28 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 098A0D71; Tue, 22 Apr 2014 23:28:28 +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 DEA5C19C8; Tue, 22 Apr 2014 23:28:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3MNSRNu090532; Tue, 22 Apr 2014 23:28:27 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3MNSR96090531; Tue, 22 Apr 2014 23:28:27 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404222328.s3MNSR96090531@svn.freebsd.org> From: Bryan Drewery Date: Tue, 22 Apr 2014 23:28:27 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r351888 - head/Mk/Scripts 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.17 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: Tue, 22 Apr 2014 23:28:28 -0000 Author: bdrewery Date: Tue Apr 22 23:28:27 2014 New Revision: 351888 URL: http://svnweb.freebsd.org/changeset/ports/351888 QAT: https://qat.redports.org/buildarchive/r351888/ Log: - Fix handling of "@comment @cwd" so it does not reset real @cwd; only change the cwd for commented lines (such as %%OPTION%%file). Reset it back to the normal on the first non-commented line. - Sort files after stripping out @comment With hat: portmgr Modified: head/Mk/Scripts/check-stagedir.sh Modified: head/Mk/Scripts/check-stagedir.sh ============================================================================== --- head/Mk/Scripts/check-stagedir.sh Tue Apr 22 23:00:01 2014 (r351887) +++ head/Mk/Scripts/check-stagedir.sh Tue Apr 22 23:28:27 2014 (r351888) @@ -63,6 +63,8 @@ if [ $makeplist = 0 ] ; then echo "===> Checking for items in STAGEDIR missing from pkg-plist" cwd=${PREFIX} + cwd_save= + commented_cwd= while read line; do # Handle deactivated OPTIONS. Treat "@comment file" as being in # the plist so it does not show up as an orphan. PLIST_SUB uses @@ -75,6 +77,19 @@ if [ $makeplist = 0 ] ; then # but later prepend it again to create a list of # all files commented and uncommented. comment="@comment " + # Only consider comment @cwd for commented lines + if [ -n "${commented_cwd}" ]; then + [ -z "${cwd_save}" ] && cwd_save=${cwd} + cwd=${commented_cwd} + fi + else + # On first uncommented line, forget about commented + # @cwd + if [ -n "${cwd_save}" ]; then + cwd=${cwd_save} + cwd_save= + commented_cwd= + fi fi case $line in @@ -107,29 +122,44 @@ if [ $makeplist = 0 ] ; then # order matters here - we must check @cwd first because # otherwise the @cwd* would also match it first, shadowing the # @cwd) line. - @cwd|@cd) cwd=${PREFIX} ;; + @cwd|@cd) + # Don't actually reset cwd for commented @cwd + if [ -n "${comment}" ]; then + commented_cwd=${PREFIX} + else + cwd=${PREFIX} + fi + ;; @cwd*|@cd*) set -- $line - cwd=$2 + newcwd=$2 # Don't set cwd=/ as it causes // in plist and # won't match later. - [ "${cwd}" = "/" ] && cwd= + [ "${newcwd}" = "/" ] && newcwd= + # Don't actually reset cwd for commented @cwd + if [ -n "${comment}" ]; then + commented_cwd=${newcwd} + else + cwd=${newcwd} + fi + unset newcwd ;; @*) ;; /*) echo "${comment}${line}" ;; *) echo "${comment}${cwd}/${line}" ;; esac - done < ${TMPPLIST} 3>${WRKDIR}/.plist-dirs-unsorted | \ - sort >${WRKDIR}/.plist-files + done < ${TMPPLIST} 3>${WRKDIR}/.plist-dirs-unsorted \ + >${WRKDIR}/.plist-files-unsorted unset TMPPLIST # Create the -no-comments files and trim out @comment from the plists. # This is used for various tests later. sed -e '/^@comment/d' ${WRKDIR}/.plist-dirs-unsorted \ >${WRKDIR}/.plist-dirs-unsorted-no-comments sed -i '' -e 's/^@comment //' ${WRKDIR}/.plist-dirs-unsorted - sed -e '/^@comment/d' ${WRKDIR}/.plist-files \ + sed -e '/^@comment/d' ${WRKDIR}/.plist-files-unsorted | sort \ >${WRKDIR}/.plist-files-no-comments - sed -i '' -e 's/^@comment //' ${WRKDIR}/.plist-files + sed -e 's/^@comment //' ${WRKDIR}/.plist-files-unsorted | sort \ + >${WRKDIR}/.plist-files else # generate plist - pretend the plist had been empty : >${WRKDIR}/.plist-dirs-unsorted