svn commit: r493983 - head/Tools/scripts
Rene Ladan
rene at FreeBSD.org
Tue Feb 26 21:51:45 UTC 2019
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
More information about the svn-ports-all
mailing list