Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Mar 2013 23:49:02 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r313779 - head/Tools/scripts
Message-ID:  <201303092349.r29Nn2bE059032@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Sat Mar  9 23:49:02 2013
New Revision: 313779
URL: http://svnweb.freebsd.org/changeset/ports/313779

Log:
  Make check_deps behave the same as check_PRs:
  propose to skip removing a port if anything depends on it, instead of infinite looping on "ignore the issue"

Modified:
  head/Tools/scripts/rmport

Modified: head/Tools/scripts/rmport
==============================================================================
--- head/Tools/scripts/rmport	Sat Mar  9 23:36:46 2013	(r313778)
+++ head/Tools/scripts/rmport	Sat Mar  9 23:49:02 2013	(r313779)
@@ -184,36 +184,30 @@ check_dep()
 	persist=${2}
 	alltorm=${3}
 
-	while : ; do
-		log "${catport}: checking dependencies"
+	log "${catport}: checking dependencies"
 
-		err=0
+	err=0
 
-		res="`check_dep_core ${catport} "${alltorm}" 2>&1`" || err=1
+	res="`check_dep_core ${catport} "${alltorm}" 2>&1`" || err=1
 
-		if [ ${err} -eq 0 ] ; then
-			break
-		fi
+	if [ ${err} -eq 0 ] ; then
+		return 0
+	fi
 
-		echo "${res}" |${PAGER:-less}
+	echo "${res}" |${PAGER:-less}
 
-		if [ ${persist} -eq 0 ] ; then
-			break
-		fi
+	if [ ${persist} -eq 0 ] ; then
+		return 0
+	fi
 
-		echo "" >&2
-		echo "you can ignore the above issues and proceed anyway." >&2
-		echo "if this is the case, then either:" >&2
-		echo " * these are false positives" >&2
-		echo " * you want to break something" >&2
-		echo " * your ${PORTSDIR} is out of date, consider setting PORTSDIR in environment" >&2
-		echo "   to point to a newer instance of the ports tree" >&2
-		echo "or you can hit \`n' to repeat the check" >&2
-		answer=`ask "ignore the above issues"`
-		if [ "${answer}" = "y" ] ; then
-			break
-		fi
-	done
+	echo "" >&2
+	echo "you can skip ${catport} and continue with the rest or remove it anyway" >&2
+	answer=`ask "do you want to skip ${catport}?"`
+	if [ "${answer}" = "y" ] ; then
+		return 1
+	else
+		return 0
+	fi
 }
 
 # query GNATS via query-pr-summary.cgi, format and return the result
@@ -506,7 +500,9 @@ for catport in $* ; do
 	catport="${cat}/${port}"
 	pkgname=`pkgname ${catport}`
 
-	check_dep ${catport} 1 "${*}"
+	if ! check_dep ${catport} 1 "${*}" ; then
+		continue
+	fi
 
 	if ! check_PRs ${catport} ${port} ; then
 		continue



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