From owner-svn-ports-all@freebsd.org Sun Aug 19 09:17:58 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C26E210878DE; Sun, 19 Aug 2018 09:17:57 +0000 (UTC) (envelope-from gerald@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D60B8E230; Sun, 19 Aug 2018 09:17:57 +0000 (UTC) (envelope-from gerald@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 4F001244E0; Sun, 19 Aug 2018 09:17:57 +0000 (UTC) (envelope-from gerald@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7J9Hvcd093235; Sun, 19 Aug 2018 09:17:57 GMT (envelope-from gerald@FreeBSD.org) Received: (from gerald@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7J9Hv1s093234; Sun, 19 Aug 2018 09:17:57 GMT (envelope-from gerald@FreeBSD.org) Message-Id: <201808190917.w7J9Hv1s093234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gerald set sender to gerald@FreeBSD.org using -f From: Gerald Pfeifer Date: Sun, 19 Aug 2018 09:17:57 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r477561 - head/Tools/scripts X-SVN-Group: ports-head X-SVN-Commit-Author: gerald X-SVN-Commit-Paths: head/Tools/scripts X-SVN-Commit-Revision: 477561 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.27 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: Sun, 19 Aug 2018 09:17:58 -0000 Author: gerald Date: Sun Aug 19 09:17:56 2018 New Revision: 477561 URL: https://svnweb.freebsd.org/changeset/ports/477561 Log: Add a stronger safety belt to this script by comparing the actual PORTREVISION (using the Ports Collection framework, not just looking at one Makefile individually at a time) before and after the bump. If the version after the bump isn't actually increased, flag that as an error. As an example, before revision r464215 (cf. bug #226533) this script would have wreaked wreak havoc on the multimedia/avidemux* ports. This hardly can be blamed on bump-revision.sh, but with the additional safety belt it does now detect such cases. How to reproduce: % cd $PORTSDIR % svn up -r 464036 multimedia/ % Tools/scripts/bump-revision.sh multimedia/avidemux* With this patch we print: INFO: multimedia/avidemux PORTREVISION= 9 found, bumping it by 1. INFO: multimedia/avidemux-cli PORTREVISION not found, adding PORTREVISION= 1 ERROR: multimedia/avidemux-cli PORTREVISION went backwards from 5 to 1! INFO: multimedia/avidemux-plugins PORTREVISION not found, adding PORTREVISION= 1 ERROR: multimedia/avidemux-plugins PORTREVISION went backwards from 5 to 1! INFO: multimedia/avidemux-qt4 PORTREVISION not found, adding PORTREVISION= 1 ERROR: multimedia/avidemux-qt4 PORTREVISION went backwards from 5 to 1! The beauty of this approach is that it goes beyond a simple text search, and leverages what the ports framework itself does. PR: 226926, 226533 Approved by: maintainer timeout (20+ weeks) Reviewed by: mandree, riggs Modified: head/Tools/scripts/bump-revision.sh Modified: head/Tools/scripts/bump-revision.sh ============================================================================== --- head/Tools/scripts/bump-revision.sh Sun Aug 19 09:17:48 2018 (r477560) +++ head/Tools/scripts/bump-revision.sh Sun Aug 19 09:17:56 2018 (r477561) @@ -48,6 +48,12 @@ trap "rm -f $tempfile" 0 1 2 3 15 while [ $# -gt 0 ] do if [ -f "$1/Makefile" ]; then + # See what the port thinks its PORTREVISION is and save that. + startdir=`pwd` + cd "$1" + pre=$(make -V PORTREVISION) + cd "$startdir" + # If the Makefile exists, continue and empty the tempfile, set up variables echo -n > $tempfile revision_str=`grep "^PORTREVISION?\?=" "$1/Makefile"` @@ -91,6 +97,15 @@ do # If it still is not there, bail out if ! grep -q "^PORTREVISION?\?=" $1/Makefile; then printc "ERROR: $1 PORTREVISION not found and failed to add it!" "red" + fi + + # See what the port now has for PORTREVISION. + cd "$1" + post=$(make -V PORTREVISION) + cd "$startdir" + + if [ "$post" -le "$pre" ]; then + printc "ERROR: $1 PORTREVISION went backwards from $pre to $post!" "red" fi ;; *)