Index: Mk/Scripts/qa.sh =================================================================== --- Mk/Scripts/qa.sh +++ Mk/Scripts/qa.sh @@ -2,8 +2,8 @@ # MAINTAINER: portmgr@FreeBSD.org # $FreeBSD$ -if [ -z "${STAGEDIR}" -o -z "${PREFIX}" -o -z "${LOCALBASE}" ]; then - echo "STAGEDIR, PREFIX, LOCALBASE required in environment." >&2 +if [ -z "${STAGEDIR}" -o -z "${PREFIX}" -o -z "${LOCALBASE}" -o -z "${REWARNFILE}" ]; then + echo "STAGEDIR, PREFIX, LOCALBASE, REWARNFILE required in environment." >&2 exit 1 fi @@ -1006,10 +1006,18 @@ return 0 } +reinplace() +{ + if [ -f ${REWARNFILE} ]; then + warn "Possible REINPLACE_CMD issues" + cat ${REWARNFILE} + fi +} + checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo" checks="$checks suidfiles libtool libperl prefixvar baselibs terminfo" checks="$checks proxydeps sonames perlcore no_arch gemdeps gemfiledeps flavors" -checks="$checks license depends_blacklist pkgmessage" +checks="$checks license depends_blacklist pkgmessage reinplace" ret=0 cd ${STAGEDIR} || exit 1 Index: Mk/bsd.port.mk =================================================================== --- Mk/bsd.port.mk +++ Mk/bsd.port.mk @@ -1617,6 +1617,9 @@ PREFIX=${PREFIX} \ LINUXBASE=${LINUXBASE} \ LOCALBASE=${LOCALBASE} \ + REWARNFILE=${WRKDIR}/reinplace_warnings.txt \ + WRKDIR=${WRKDIR} \ + WRKSRC=${WRKSRC} \ "STRIP=${STRIP}" \ TMPPLIST=${TMPPLIST} \ CURDIR='${.CURDIR}' \ @@ -2005,7 +2008,11 @@ # Macro for doing in-place file editing using regexps REINPLACE_ARGS?= -i.bak +.if defined(DEVELOPER) +REINPLACE_CMD?= ${SETENV} REWARNFILE=${WRKDIR}/reinplace_warnings.txt ${PORTSDIR}/Tools/scripts/sed_checked.sh +.else REINPLACE_CMD?= ${SED} ${REINPLACE_ARGS} +.endif # Names of cookies used to skip already completed stages EXTRACT_COOKIE?= ${WRKDIR}/.extract_done.${PORTNAME}.${PREFIX:S/\//_/g} Index: Tools/scripts/sed_checked.sh =================================================================== --- /dev/null +++ Tools/scripts/sed_checked.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +#set -x + +/usr/bin/sed -i.bak "$@" +for x in "${@}" ; do + if [ -f "${x}" ]; then + cmp "${x}" "${x}".bak > /dev/null 2>&1 + if [ $? -ne 1 ]; then + if [ ! -z "${REWARNFILE}" ]; then + echo sed failed: backup file same as original: ${x} >> ${REWARNFILE} + fi + fi + fi +done