From owner-svn-ports-all@freebsd.org Tue May 17 17:52:00 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CFA4B3F146; Tue, 17 May 2016 17:52:00 +0000 (UTC) (envelope-from rene@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 mx1.freebsd.org (Postfix) with ESMTPS id 59A9816A8; Tue, 17 May 2016 17:52:00 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HHpxob025803; Tue, 17 May 2016 17:51:59 GMT (envelope-from rene@FreeBSD.org) Received: (from rene@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HHpxS5025802; Tue, 17 May 2016 17:51:59 GMT (envelope-from rene@FreeBSD.org) Message-Id: <201605171751.u4HHpxS5025802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rene set sender to rene@FreeBSD.org using -f From: Rene Ladan Date: Tue, 17 May 2016 17:51:59 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r415399 - head/Tools/scripts X-SVN-Group: ports-head 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.22 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: Tue, 17 May 2016 17:52:00 -0000 Author: rene Date: Tue May 17 17:51:59 2016 New Revision: 415399 URL: https://svnweb.freebsd.org/changeset/ports/415399 Log: As a frequent user of the rmport script, it was time for some improvements: - allow PORTSDIR to be a symbolic link when looking for expired ports or dependent ports - allow for trailing slashes when specifying ports as cat/name. This prevents the port being a false positive for itself when the Makefile mentions the port name (e.g., in PLIST_FILES) - fetch possibly open PRs via Bugzilla, GNATS is long gone. Remove the version that used freefall. Thanks to crees for pretty-printing the results. - forcibly delete the temporary checkout to prevent rm(1) from asking for confirmation on each file in .svn - add myself as author Approved by: maintainer (crees) Differential Revision: https://reviews.freebsd.org/D6396 Modified: head/Tools/scripts/rmport Modified: head/Tools/scripts/rmport ============================================================================== --- head/Tools/scripts/rmport Tue May 17 17:51:03 2016 (r415398) +++ head/Tools/scripts/rmport Tue May 17 17:51:59 2016 (r415399) @@ -31,6 +31,7 @@ # Originally written by Vasil Dimov # Others: # Chris Rees +# Rene Ladan # # $FreeBSD$ # @@ -107,7 +108,7 @@ find_expired() { EXPVAR=EXPIRATION_DATE - find ${PORTSDIR} -mindepth 3 -maxdepth 3 -name "Makefile*" \ + find -H ${PORTSDIR} -mindepth 3 -maxdepth 3 -name "Makefile*" \ |xargs grep -H ${EXPVAR} \ |sed -E "s|${PORTSDIR}/?([^/]+/[^/]+)/Makefile:${EXPVAR}=[[:space:]]*([0-9-]{10})$|\2 \1|g" \ |perl -ne "if ((substr(\$_, 0, 10) cmp '${TODAY}') <= 0) { print(\$_); }" \ @@ -147,6 +148,7 @@ check_dep_core() rmpkgs="" rmcatports="" for torm in ${alltorm} ; do + torm="`echo ${torm} | sed 's/\/$//'`" rmpkgs="${rmpkgs:+${rmpkgs}|}`pkgname ${torm}`" rmcatports="${rmcatports:+${rmcatports}|}${PORTSDIR}/${torm}/" done @@ -162,7 +164,7 @@ check_dep_core() # check if some Makefiles mention the port to be deleted portdir_grep="^[^#].*/`basename ${catport}`([[:space:]]|/|$)" - r="`find ${PORTSDIR} -mindepth 2 -maxdepth 3 \ + r="`find -H ${PORTSDIR} -mindepth 2 -maxdepth 3 \ \( -name "Makefile*" -or -path "*Mk/*.mk" \) \ |xargs grep -EH "${portdir_grep}" \ |grep -vE "^(${rmcatports})" || :`" @@ -210,18 +212,16 @@ check_dep() fi } -# query GNATS via query-pr-summary.cgi, format and return the result +# query GNATS via Bugzilla, format and return the result +# XXX rene: PRs are listed twice for now due to the HTML code of Bugzilla get_PRs_www() { catport=${1} synopsis=${2} - date_re='[0-9]{4}/[0-9]{2}/[0-9]{2}' - prnum_re='.+/[0-9]{5,6}' - synopsis_re='.{10,}' log "${catport}: getting PRs having ${synopsis} in the synopsis" - url="http://www.freebsd.org/cgi/query-pr-summary.cgi?text=${synopsis}" + url="https://bugs.freebsd.org/bugzilla/buglist.cgi?quicksearch=${synopsis}" raw="`fetch -q -T 20 -o - "${url}"`" @@ -231,28 +231,17 @@ get_PRs_www() fi printf "%s" "${raw}" \ - |sed -nE "s|.*>(${date_re})<.*>(${prnum_re})<.*>(${synopsis_re})