From owner-svn-ports-all@FreeBSD.ORG Sat Nov 23 12:23:20 2013 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 19293F32; Sat, 23 Nov 2013 12:23:20 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EE59925BA; Sat, 23 Nov 2013 12:23:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rANCNJVr088599; Sat, 23 Nov 2013 12:23:19 GMT (envelope-from mandree@svn.freebsd.org) Received: (from mandree@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rANCNJ6C088595; Sat, 23 Nov 2013 12:23:19 GMT (envelope-from mandree@svn.freebsd.org) Message-Id: <201311231223.rANCNJ6C088595@svn.freebsd.org> From: Matthias Andree Date: Sat, 23 Nov 2013 12:23:19 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r334663 - 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.16 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: Sat, 23 Nov 2013 12:23:20 -0000 Author: mandree Date: Sat Nov 23 12:23:19 2013 New Revision: 334663 URL: http://svnweb.freebsd.org/changeset/ports/334663 Log: - in qa.sh, properly work with filenames containing blank or tab, by setting IFS to just LF - in check-stagedir.sh, properly detect unset environmental variables, and list them all - in check-stagedir.sh, also list the full prefix as known, not just its parents PR: 184039 Approved by: portmgr (bapt) Modified: head/Mk/Scripts/check-stagedir.sh (contents, props changed) head/Mk/Scripts/qa.sh Modified: head/Mk/Scripts/check-stagedir.sh ============================================================================== --- head/Mk/Scripts/check-stagedir.sh Sat Nov 23 12:16:10 2013 (r334662) +++ head/Mk/Scripts/check-stagedir.sh Sat Nov 23 12:23:19 2013 (r334663) @@ -1,5 +1,6 @@ #!/bin/sh # ports/Mk/Scripts/check-stagedir.sh - called from ports/Mk/bsd.stage.mk +# $FreeBSD$ set -e export LC_ALL=C @@ -21,16 +22,17 @@ case "$1" in esac # validate environment -envfault=0 +envfault= for i in STAGEDIR PREFIX LOCALBASE WRKDIR WRKSRC MTREE_FILE \ TMPPLIST DATADIR DOCSDIR EXAMPLESDIR do - if eval test -z "\$$i" ; then - echo >&2 "Environment variable $i undefined. Aborting." - envfault=1 + if ! ( eval ": \${${i}?}" ) 2>/dev/null ; then + envfault="${envfault}${envfault:+" "}${i}" fi done -if [ $envfault -ne 0 ] ; then +if [ -n "$envfault" ] ; then + echo "Environment variables $envfault undefined. Aborting." \ + | fmt >&2 exit 1 fi @@ -85,9 +87,9 @@ fi a=${PREFIX} while :; do + echo ${a} a=${a%/*} [ -z "${a}" ] && break - echo ${a} done } > ${WRKDIR}/.mtree Modified: head/Mk/Scripts/qa.sh ============================================================================== --- head/Mk/Scripts/qa.sh Sat Nov 23 12:16:10 2013 (r334662) +++ head/Mk/Scripts/qa.sh Sat Nov 23 12:23:19 2013 (r334663) @@ -7,6 +7,9 @@ if [ -z "${STAGEDIR}" -o -z "${PREFIX}" exit 1 fi +LF=$(printf '\nX') +LF=${LF%X} + warn() { echo "Warning: $@" >&2 } @@ -17,7 +20,7 @@ err() { shebang() { rc=0 - for f in `find ${STAGEDIR} -type f`; do + IFS="$LF" ; for f in `find ${STAGEDIR} -type f`; do interp=$(sed -n -e '1s/^#![[:space:]]*\([^[:space:]]*\).*/\1/p;2q' $f) case "$interp" in "") ;; @@ -37,7 +40,7 @@ shebang() { symlinks() { rc=0 - for l in `find ${STAGEDIR} -type l`; do + IFS="$LF" ; for l in `find ${STAGEDIR} -type l`; do link=$(readlink ${l}) case "${link}" in ${STAGEDIR}*) err "Bad symlinks ${l} pointing inside the stage directory" @@ -50,7 +53,7 @@ symlinks() { paths() { rc=0 dirs="${STAGEDIR} ${WRKDIR}" - for f in `find ${STAGEDIR} -type f`;do + IFS="$LF" ; for f in `find ${STAGEDIR} -type f`;do for d in ${dirs}; do if grep -q ${d} ${f} ; then err "${f} is referring to ${d}" @@ -64,7 +67,7 @@ paths() { stripped() { [ -x /usr/bin/file ] || return # this is fatal [ -n "${STRIP}" ] || return 0 - for f in `find ${STAGEDIR} -type f`; do + IFS="$LF" ; for f in `find ${STAGEDIR} -type f`; do output=`/usr/bin/file ${f}` case "${output}" in *:*\ ELF\ *,\ not\ stripped*) warn "${f} is not stripped consider using \${STRIP_CMD}";;