From owner-svn-ports-all@freebsd.org Mon Oct 19 12:19:14 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D986C44E851; Mon, 19 Oct 2020 12:19:14 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFG5Z5Vczz4X99; Mon, 19 Oct 2020 12:19:14 +0000 (UTC) (envelope-from swills@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A10CD23791; Mon, 19 Oct 2020 12:19:14 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09JCJEfe070283; Mon, 19 Oct 2020 12:19:14 GMT (envelope-from swills@FreeBSD.org) Received: (from swills@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JCJEvX070282; Mon, 19 Oct 2020 12:19:14 GMT (envelope-from swills@FreeBSD.org) Message-Id: <202010191219.09JCJEvX070282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: swills set sender to swills@FreeBSD.org using -f From: Steve Wills Date: Mon, 19 Oct 2020 12:19:14 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r552736 - head/Mk/Scripts X-SVN-Group: ports-head X-SVN-Commit-Author: swills X-SVN-Commit-Paths: head/Mk/Scripts X-SVN-Commit-Revision: 552736 X-SVN-Commit-Repository: ports 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.33 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, 19 Oct 2020 12:19:14 -0000 Author: swills Date: Mon Oct 19 12:19:14 2020 New Revision: 552736 URL: https://svnweb.freebsd.org/changeset/ports/552736 Log: Revert Modified: head/Mk/Scripts/sed_checked.sh (contents, props changed) Modified: head/Mk/Scripts/sed_checked.sh ============================================================================== --- head/Mk/Scripts/sed_checked.sh Mon Oct 19 11:56:42 2020 (r552735) +++ head/Mk/Scripts/sed_checked.sh Mon Oct 19 12:19:14 2020 (r552736) @@ -1,84 +1,13 @@ #!/bin/sh -# Rationale: -# The ports tree has accumulated quite a bit of REINPLACE_CMD lines -# in its Makefile. Some of these have gone stale as ports were updated -# upstream, or as the ports have evolved. - -# For DEVELOPERS, we check the effectiveness of REINPLACE_CMD lines -# by requesting backup files be written, and comparing them against -# source files. - -set -eu - -DEBUG=: -#DEBUG=echo - -check_dash_i() { - # this must be called from a subshell so as not to clobber $@ - # WARNING: assumes that -i is given at least once! - unset OPTIND - $DEBUG >&2 DEBUG: check_dash_i "$@" - while getopts :EI:ae:f:i:lnru var ; do - $DEBUG >&2 DEBUG: option "$var" '"'"${OPTARG-""}"'"' - case "$var" in [iI]) - last_i="$OPTARG" - esac - done - - $DEBUG >&2 DEBUG: last_i='"'"$last_i"'"' - printf '"%s"\n' "$last_i" -} - -shadowed="$( (check_dash_i -i.bak "$@") )" -if [ "$shadowed" != '".bak"' ] ; then - echo >&2 "WARNING: $0 -i.bak clobbered by caller's backup suffix $shadowed" -fi - -${SED-/usr/bin/sed} -i.bak "$@" -check() { - issues=0 - files=0 - args= - for x in "${@}" ; do - # we decide very simply whether the argument we are looking at is - # a sed command or a file: if it's not a regular file, it must be - # a sed argument worth collecting for our warning message, - # so that maintainers can identify the failing sed command. - # - # We cannot easily relate to Makefile lines here. - if [ -f "${x}" ]; then - # File? Check if sed was effective. - files=$(($files + 1)) - if cmp -s "${x}" "${x}".bak ; then - issues=$(($issues + 1)) - if [ $issues -eq 1 ] ; then - echo "sed failed:${args} ..." - fi - echo " - file content unchanged from backup: ${x#${WRKSRC}/}" - fi - else - # Not a file? Collect sed(1) command. - args="${args} ${x}" - fi - done - - if [ ${issues} -gt 0 ] ; then - action="review" - if [ ${issues} -eq ${files} ] ; then - action=" FIX " # blanks at either end - else - action="review" - fi - echo "--- issues found: ${issues}, files to edit: ${files}, please ${action} ---" +set -e +/usr/bin/sed -i.bak "$@" +for x in "${@}" ; do + if [ -f "${x}" ]; then + if cmp -s "${x}" "${x}".bak ; then + if [ ! -z "${REWARNFILE}" ]; then + echo - - REINPLACE_CMD ran, but did not modify file contents: ${x#${WRKSRC}/} >> ${REWARNFILE} + fi + fi fi -} - -if [ ! -z "${REWARNFILE}" ] ; then - check "$@" | tee -a ${REWARNFILE} - # if ${REWARNFILE} is a regular file (not /dev/null) and empty, delete it. - if [ -f "${REWARNFILE}" -a ! -s "${REWARNFILE}" ] ; then rm -f "${REWARNFILE}" ; fi -else - check "$@" -fi - +done