From owner-svn-ports-all@freebsd.org Thu Mar 28 17:01:18 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 C5E961562CCB; Thu, 28 Mar 2019 17:01:18 +0000 (UTC) (envelope-from mfechner@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 651A58165B; Thu, 28 Mar 2019 17:01:18 +0000 (UTC) (envelope-from mfechner@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 42404221AD; Thu, 28 Mar 2019 17:01:18 +0000 (UTC) (envelope-from mfechner@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2SH1ILO062884; Thu, 28 Mar 2019 17:01:18 GMT (envelope-from mfechner@FreeBSD.org) Received: (from mfechner@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SH1HDv062874; Thu, 28 Mar 2019 17:01:17 GMT (envelope-from mfechner@FreeBSD.org) Message-Id: <201903281701.x2SH1HDv062874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mfechner set sender to mfechner@FreeBSD.org using -f From: Matthias Fechner Date: Thu, 28 Mar 2019 17:01:17 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r497031 - head/Tools/scripts X-SVN-Group: ports-head X-SVN-Commit-Author: mfechner X-SVN-Commit-Paths: head/Tools/scripts X-SVN-Commit-Revision: 497031 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 651A58165B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,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: Thu, 28 Mar 2019 17:01:19 -0000 Author: mfechner Date: Thu Mar 28 17:01:17 2019 New Revision: 497031 URL: https://svnweb.freebsd.org/changeset/ports/497031 Log: Added a script to bump PORTREVISION if a library has changed a version like libgit2. Just execute it in the root of you ports with e.g. Tools/scripts/search_lib_depends_and_bump.sh devel/libgit2 This will search over all existing ports, check if they need to be bumped. After all ports are bumped it triggers a portlint for each modified port. The portlint loop continues till all errors and warnings are fixed. Feel free to break this loop using CTRL+C. Added: head/Tools/scripts/search_lib_depends_and_bump.sh (contents, props changed) Modified: head/Tools/scripts/README Modified: head/Tools/scripts/README ============================================================================== --- head/Tools/scripts/README Thu Mar 28 16:49:39 2019 (r497030) +++ head/Tools/scripts/README Thu Mar 28 17:01:17 2019 (r497031) @@ -45,6 +45,8 @@ portsearch - A utility for searching the ports tree. I all perl(1) regular expressions. resolveportsfromlibs.sh - Prints the name(s) of ports(s) given a library filename, suitable for direct use in LIB_DEPENDS. +search_lib_depends_and_bump.sh - Give it a port that has changed and it will bump + all ports having a LIB_DEPENDS on this port splitpatch.pl - A small script to convert multi-file patches to several appropriately named single-file patches. tindex - script used to build INDEXes for supported FreeBSD branches, which Added: head/Tools/scripts/search_lib_depends_and_bump.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/Tools/scripts/search_lib_depends_and_bump.sh Thu Mar 28 17:01:17 2019 (r497031) @@ -0,0 +1,107 @@ +#!/bin/sh +# +# You pass the script a port where the library has changed its ABI. +# The script will search for this port over the complete directory you are located now +# and will bump all ports using `Tools/scripts/bump-revision.sh` +# +# Version 0.1 +# License: MIT +# Matthias Fechner + +usage() { + echo "$0 devel/libgit2" + echo "" + echo "Search for all ports having devel/libgit2 as a LIB_DEPENDS" + echo "and bump the REVISION using the script 'Tools/scripts/bump-revision.sh'" + echo "After this check all modified ports with portlint." + echo "" + echo "Make sure you execute the script in the ports directory." + exit 1 +} + +[ "${1}" != "" ] || usage + +# check that portlint is available +if [ x`which portlint` = x"" ]; then + echo "Please install portlint with" + echo "pkg install portlint" + echo "to continue." + exit 1; +fi + +PORT_TO_SEARCH=${1} +BASEDIR=$(pwd) +# Get a list of all ports +echo "Prepare a list of all ports" +ports=$(find . -name Makefile -path "./editors/*" ! -path "./Tools/* | sort") +echo "done." +echo + +PORTS_TO_BUMP="" +echo Check ports with dependency to ${PORT_TO_SEARCH} +for port in ${ports}; do + DIR=$(dirname "${port}") + printf "Analyse ${DIR}" + LIBDEPENDS=$(make -n -V LIB_DEPENDS -C ${DIR}) + #echo "Search >${PORT_TO_SEARCH}< in >${LIBDEPENDS}<" + case "${LIBDEPENDS}" in + *"${PORT_TO_SEARCH}"*) + PORTS_TO_BUMP="${PORTS_TO_BUMP} ${DIR}";; + esac + printf "\033[2K\r" +done +echo "done." + +echo "Bump PORTREVISION of following ports:" +for PORT_TO_BUMP in ${PORTS_TO_BUMP}; do + echo ${PORT_TO_BUMP} +done +echo +read -p "Press CTRL+c to stop or ENTER to continue..." USERINPUT + +for PORT_TO_BUMP in ${PORTS_TO_BUMP}; do + sh ./Tools/scripts/bump-revision.sh ${PORT_TO_BUMP} +done + +# Now we run portlint on all port we modified +# I borrowed here code from doportlint +echo +TMPFILE=$(mktemp) +while [ "1" = "1" ] +do + FAILED_PORTS="" + FAILURES=0 + echo "Use TMP file ${TMPFILE}" + for PORT in ${PORTS_TO_BUMP}; do + FAILURE=0 + echo "Running portlint in ${PORT}" + cd ${PORT} + portlint > ${TMPFILE} 2> /dev/null || FAILURE=1 + grep '^looks fine\.$' ${TMPFILE} > /dev/null 2> /dev/null || FAILURE=1 + + if [ x${FAILURE} = "x1" ]; then + FAILURES=$((${FAILURES}+1)) + FAILED_PORTS="${FAILED_PORTS} ${PORT}" + { echo '--------------- portlint failed for '${PORT}; \ + grep -v '^OK:' ${TMPFILE} |\ + sed -e 's/^0 fatal errors and //'; } + echo "" + fi + rm -f ${TMPFILE} + cd ${BASEDIR} + done + if [ x${FAILURES} = "x0" ]; then + echo "All portlint test successfull, please review the changes before you commit them carefully." + echo "You maybe want to run now" + echo "git diff" + echo "svn diff" + echo + break; + fi + PORTS_TO_BUMP=${FAILED_PORTS} + read -p "${FAILURES} failures, please fix portlint error and warnings and press ENTER to retest" USERINPUT + echo + echo + echo "------------------------------------ NEW Portlint -----------------------------" +done +