From owner-svn-ports-all@freebsd.org Sun Aug 19 13:08:30 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 8ABEF108C5E4 for ; Sun, 19 Aug 2018 13:08:30 +0000 (UTC) (envelope-from adamw@adamw.org) Received: from mail-yb0-x244.google.com (mail-yb0-x244.google.com [IPv6:2607:f8b0:4002:c09::244]) (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 160F474F9D for ; Sun, 19 Aug 2018 13:08:30 +0000 (UTC) (envelope-from adamw@adamw.org) Received: by mail-yb0-x244.google.com with SMTP id o17-v6so3624269yba.2 for ; Sun, 19 Aug 2018 06:08:30 -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=bNTaJdm1/rnTQQ8Q9obW3kbwR3CbHWkl9ZG1oJ/T5AI=; b=u7PsDJiziB6FOsEh7ND7QJLmFb35fp9AwBGFiv+41Or1GPLvz7PCA6Be8NNkGASIQ/ e3WODPBi+aZ4ZxCMHqSnVzhozW7kPeRKDgVST8mqIfrRf95RofgWlVU8Jgc0P6JQu8Jk Jur3FHc7gzIHX6xip/qWfYWr1e7IbrCR1C1wVaEhSpMZtAVg867qEVdgSl/8wrLXlCX2 8cE9TDnnpB40G4IzWl7072jfYn8AhYx58AGbM6Lt6fuNe1xJCLcqGs+tm0VjhzICVSsH 3ke0Rx2ifVvWoeEx+oW6lzRZ+Htko6b8P+aIhG/1IeefzirquG6ndXO4OWy3NIh8Ssdc xO+w== 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=bNTaJdm1/rnTQQ8Q9obW3kbwR3CbHWkl9ZG1oJ/T5AI=; b=olBm3BbCszqTO69yLvY0iFUXZWR7wUPy3jGwVVCAQGh1jOp8gtnXY1VpYKPp3NPQb6 Cex9udtwAHeG77PqQgcUoCV2Q87Bzz94dnD5IgSj5+AhOakEKVg6TuP9xsvpvKSAJUGg WtO07APICQJ4drzk/waNdBD0Nf5Vk/vf37mzZa7UBoVkW1vmF96AO30yOSfVwVKv4iCA hmd9G8OSpGD5RjndF0uTjbR7OcD21cgQsK7eKbE/GILuTd2enMARBxMwVeEkCj9NrESK HfHy8Tou4xSEcYlZcH1pKmeXGcLheUs5lqhRDHXvIipQ/lNWBInIxf0uQqQG1nUpac8r l/2A== X-Gm-Message-State: AOUpUlHBBZCSmP8DdvJeu44fAq3z5t1IpqQaFYhTJTR5dHe4W6vn/1pq QcMuzxp6XNTKnxOOAgbCk256VAf6UwfRYLxsNJmaYQ== X-Google-Smtp-Source: AA+uWPx9YVY5UDgd/eHyw27iIkcWMaWgTk9uEuvS9GJjLQeM0UZwPSioPFDvobNvT2nCupLgG11Oe0O8tx9vvbGW5MQ= X-Received: by 2002:a25:586:: with SMTP id 128-v6mr7769975ybf.282.1534684109533; Sun, 19 Aug 2018 06:08:29 -0700 (PDT) MIME-Version: 1.0 References: <201808190917.w7J9Hv1s093234@repo.freebsd.org> In-Reply-To: From: Adam Weinberger Date: Sun, 19 Aug 2018 07:08:13 -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 13:08:30 -0000 On Sun, Aug 19, 2018 at 6:59 AM Adam Weinberger wrote: > > 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. Hit send too soon. Consider also checking not just for PORTREVISION---consider checking that the new version string itself is greater, according to the tool that actually makes that final decision. pre=$(make -C "$1" -V PKGVERSION) post=$(make -C "$1" -V PKGVERSION) if [ "$(pkg version -t "$pre" "$post")" != "<" ]; then echo "Didn't increase" fi -- Adam Weinberger adamw@adamw.org https://www.adamw.org