From owner-svn-ports-all@freebsd.org Sun Aug 19 12:59:46 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 D2318108C435 for ; Sun, 19 Aug 2018 12:59:45 +0000 (UTC) (envelope-from adamw@adamw.org) Received: from mail-yw1-xc2b.google.com (mail-yw1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7042D74BB5 for ; Sun, 19 Aug 2018 12:59:45 +0000 (UTC) (envelope-from adamw@adamw.org) Received: by mail-yw1-xc2b.google.com with SMTP id j131-v6so176341ywc.13 for ; Sun, 19 Aug 2018 05:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamw-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Qg/+W+FeOlqA0xjzMTOxmtmdpH7H7dMKbOqZ+YCqf5Y=; b=kJUHEca+ILCfa6NjJOM6NOKVyZ7qTNJ4Il4c0jrrBOOI1e9y+qCrE0D5cBqDQ3vcWP qNHR5toh944GQsBnrLO/4PDR8CWTP8kZmF25UvWUIUHTc0u6BCgaG8fSeKoVfDivGArf N7h6OhrAA+8rDaB4DthhDZHZqbqELr2RT0bkEznk+V5IlK/0G/5UCA+yRHz5MA28VNHF K1IFVs3tZFU49feWSxLe7rjJ3i82/LpTXLB1OKo+KNWB5D0i/0SN8RlgS1KpahUgtcWi em3GmjXymyOTWbUZS0hy+c8SSMzmoorz6TALww3wMC5n9ZckV7rs0Lm0ICeDwd0m4zqq JeBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Qg/+W+FeOlqA0xjzMTOxmtmdpH7H7dMKbOqZ+YCqf5Y=; b=exz2SKI4MvAsWvrCBlokpHr8j4VG5F1HcRshwkNT3cwWpKqO8iATnwTVh1TZmRX0C8 8wC2Z+Hqx23dBdraB6N8v7ji0FB0CGqo6LUINDsIuUshToT+bYaRS5QiU81UIrLkFzyy m10BVgVu5SVu/3ael15L/sv50hHMWaFm7gVMYMX467t5Tuhy0rzC6Ol8vZ2vBkJMxTte YBW5ja6w/19n1kVsPq2FZUKLAh9Js5GGR/xI+HrycmhXvgp3amwiI5AD434P9E4P2nZ/ YvY+cfLBqbvfP534nUbmkybA87axccz0jCXMpkL63/xAULtHfTnIVJEuNBco0Gfio+Ia irpw== X-Gm-Message-State: AOUpUlH8d42nVzfw46h3UGkYm5WVdC1nHGASOuGrYIgcMQhVCjsHaFBG oXgGw5jnevLTRNHtJfPQ5AATc5KpOOmW1werVsIxtw== X-Google-Smtp-Source: AA+uWPxsuO1PDG5yRuJXf0Z0vySio9AJVqeXJ+WReGwYChvMecB9Uy6q9PhdKtA0RigxvFhU0D/Q/F6rkrzAMmehwoM= X-Received: by 2002:a81:1a43:: with SMTP id a64-v6mr23782090ywa.9.1534683584815; Sun, 19 Aug 2018 05:59:44 -0700 (PDT) MIME-Version: 1.0 References: <201808190917.w7J9Hv1s093234@repo.freebsd.org> In-Reply-To: <201808190917.w7J9Hv1s093234@repo.freebsd.org> From: Adam Weinberger Date: Sun, 19 Aug 2018 06:59:28 -0600 Message-ID: Subject: Re: svn commit: r477561 - head/Tools/scripts To: gerald@freebsd.org Cc: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Content-Type: text/plain; charset="UTF-8" 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 12:59:46 -0000 On Sun, Aug 19, 2018 at 3:18 AM Gerald Pfeifer wrote: > > 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" You can just post=$(make -C "$1" -V PORTREVISION), instead of saving pwd and cd'ing multiple times. # Adam -- Adam Weinberger adamw@adamw.org https://www.adamw.org