From owner-svn-ports-all@freebsd.org Tue Feb 26 21:51:45 2019 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 B395B15051EF; Tue, 26 Feb 2019 21:51:45 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5523C7512E; Tue, 26 Feb 2019 21:51:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 484ADB41C; Tue, 26 Feb 2019 21:51:45 +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 x1QLpj3E088224; Tue, 26 Feb 2019 21:51:45 GMT (envelope-from rene@FreeBSD.org) Received: (from rene@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QLpj8X088223; Tue, 26 Feb 2019 21:51:45 GMT (envelope-from rene@FreeBSD.org) Message-Id: <201902262151.x1QLpj8X088223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rene set sender to rene@FreeBSD.org using -f From: Rene Ladan Date: Tue, 26 Feb 2019 21:51:45 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r493983 - head/Tools/scripts X-SVN-Group: ports-head X-SVN-Commit-Author: rene X-SVN-Commit-Paths: head/Tools/scripts X-SVN-Commit-Revision: 493983 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5523C7512E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 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, 26 Feb 2019 21:51:45 -0000 Author: rene Date: Tue Feb 26 21:51:44 2019 New Revision: 493983 URL: https://svnweb.freebsd.org/changeset/ports/493983 Log: rmport: correctly deal with expired ports when the -a (find all expired) option. Instead of grepping port Makefiles for EXPIRATION_DATE, evaluate this variable using make. Also find ports by evaluating SUBDIR recursively instead of using find on Makefile\* Submitted by: crees (maintainer) Approved by: crees (maintainer) Modified: head/Tools/scripts/rmport Modified: head/Tools/scripts/rmport ============================================================================== --- head/Tools/scripts/rmport Tue Feb 26 21:13:33 2019 (r493982) +++ head/Tools/scripts/rmport Tue Feb 26 21:51:44 2019 (r493983) @@ -116,19 +116,27 @@ find_catport() fi } -find_expired() +find_expired() # [category [port]] { EXPVAR=EXPIRATION_DATE - find -H ${PORTSDIR} -mindepth 3 -maxdepth 3 -name "Makefile*" \ - |xargs grep -H "^${EXPVAR}" \ - |grep -v '^#' \ - |sed -E "s|${PORTSDIR}/?([^/]+/[^/]+)/Makefile[^:]*:${EXPVAR}=[[:space:]]*([0-9-]{10})$|\2 \1|g" \ - |perl -ne "if ((substr(\$_, 0, 10) cmp '${TODAY}') <= 0) { print(\$_); }" \ - |while read expdate catport ; do \ - echo -n "${expdate} ${catport}: " ; \ - make -C ${PORTSDIR}/${catport} -V DEPRECATED ; \ + # Called bare, just discovers categories + if [ -z "$1" ]; then + for category in $(make -C ${PORTSDIR} -VSUBDIR); do + find_expired $category done + elif [ -z "$2" ]; then + for port in $(make -C ${PORTSDIR}/$1 -VSUBDIR); do + find_expired $1 $port + done + else + DATE="$(make -C${PORTSDIR}/$1/$2 -V${EXPVAR})" + [ -n "$DATE" ] || return + if [ ! "$DATE" \> "${TODAY}" ]; then + echo "${DATE} $1/$2: "; + make -C${PORTSDIR}/$1/$2 -VDEPRECATED + fi + fi } # create temporary checkout directory