Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Aug 2018 00:39:32 +0000 (UTC)
From:      Gerald Pfeifer <gerald@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r477615 - head/Tools/scripts
Message-ID:  <201808200039.w7K0dWbM069393@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gerald
Date: Mon Aug 20 00:39:32 2018
New Revision: 477615
URL: https://svnweb.freebsd.org/changeset/ports/477615

Log:
  Use 'make -C' instead of saving the current working directory and then
  restoring that in the new code to add a safety belt that came in via
  revision 477561.  This is quite a bit simpler and shorter.
  
  Reported by:	adamw
  PR:		226926

Modified:
  head/Tools/scripts/bump-revision.sh

Modified: head/Tools/scripts/bump-revision.sh
==============================================================================
--- head/Tools/scripts/bump-revision.sh	Mon Aug 20 00:38:40 2018	(r477614)
+++ head/Tools/scripts/bump-revision.sh	Mon Aug 20 00:39:32 2018	(r477615)
@@ -49,10 +49,7 @@ 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"
+        pre=$(make -C "$1" -V PORTREVISION)
 
         # If the Makefile exists, continue and empty the tempfile, set up variables
 	echo -n > $tempfile
@@ -100,9 +97,7 @@ do
             fi
 
             # See what the port now has for PORTREVISION.
-            cd "$1"
-            post=$(make -V PORTREVISION)
-            cd "$startdir"
+            post=$(make -C "$1" -V PORTREVISION)
 
             if [ "$post" -le "$pre" ]; then
                 printc "ERROR: $1 PORTREVISION went backwards from $pre to $post!" "red"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808200039.w7K0dWbM069393>