From owner-svn-ports-all@freebsd.org Sat Oct 29 10:10:35 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 057A0C25E53; Sat, 29 Oct 2016 10:10:35 +0000 (UTC) (envelope-from mat@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 C887499; Sat, 29 Oct 2016 10:10:34 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9TAAXHD028572; Sat, 29 Oct 2016 10:10:33 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9TAAXAW028570; Sat, 29 Oct 2016 10:10:33 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201610291010.u9TAAXAW028570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Sat, 29 Oct 2016 10:10:33 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r424899 - in head/Mk: . 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.23 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: Sat, 29 Oct 2016 10:10:35 -0000 Author: mat Date: Sat Oct 29 10:10:33 2016 New Revision: 424899 URL: https://svnweb.freebsd.org/changeset/ports/424899 Log: Add a Perl CORE QA check. This will use Module::CoreList to tell you if a dependency you added can be removed, or only conditionally added. Approved by: bapt Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D7832 Modified: head/Mk/Scripts/qa.sh (contents, props changed) head/Mk/bsd.port.mk (contents, props changed) Modified: head/Mk/Scripts/qa.sh ============================================================================== --- head/Mk/Scripts/qa.sh Sat Oct 29 09:30:14 2016 (r424898) +++ head/Mk/Scripts/qa.sh Sat Oct 29 10:10:33 2016 (r424899) @@ -12,6 +12,10 @@ fi LF=$(printf '\nX') LF=${LF%X} +notice() { + echo "Notice: $@" >&2 +} + warn() { echo "Warning: $@" >&2 } @@ -703,9 +707,53 @@ sonames() { EOT } +perlcore() { + local portname version module gotsome + [ -x "${LOCALBASE}/bin/corelist" ] || return 0 + for dep in ${UNIFIED_DEPENDS}; do + portname=$(expr "${dep}" : ".*/p5-\(.*\)") + if [ -n "${portname}" ]; then + gotsome=1 + module=$(echo ${portname}|sed -e 's/-/::/g') + version=$(expr "${dep}" : ".*>=*\([^:<]*\)") + + while read l; do + case "${l}" in + *was\ not\ in\ CORE*) + # This never was with Perl + # CORE, so nothing to do here + ;; + *and\ removed*) + # This was in Perl CORE but has + # been removed since. + warn "${dep##*:} was in Perl CORE. Check with \`corelist ${module} ${version}\` and \`corelist -a ${module}\` if it should be conditionally added depending on PERL_LEVEL" + ;; + *deprecated*in*) + # This is in Perl CORE but is + # deprecated. + warn "${dep##*:} is in Perl CORE but deprecated. Check with \`corelist ${module} ${version}\` and \`corelist -a ${module}\` if the dependency is really needed or if it should be conditionally added depending on PERL_LEVEL" + ;; + *was\ first\ released*) + # This is in Perl CORE and is + # maybe not needed. + warn "${dep##*:} is present in Perl CORE. Check with \`corelist ${module} ${version}\` and \`corelist -a ${module}\` if the dependency is really needed or if it should be conditionally added depending on PERL_LEVEL" + ;; + *) + err "This line is not handled: \"${l}\"" + esac + done <<-EOT + $(${LOCALBASE}/bin/corelist "${module}"|tail -1) + EOT + fi + done + if [ -n "${gotsome}" ] && ! pkg info -e devel/p5-Module-CoreList; then + notice "You have some Perl modules as dependencies but you do not have devel/p5-Module-CoreList installed, the perlcore QA check gets better results when using it, especially with older Perl versions." + fi +} + checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo" checks="$checks suidfiles libtool libperl prefixvar baselibs terminfo" -checks="$checks proxydeps sonames" +checks="$checks proxydeps sonames perlcore" ret=0 cd ${STAGEDIR} Modified: head/Mk/bsd.port.mk ============================================================================== --- head/Mk/bsd.port.mk Sat Oct 29 09:30:14 2016 (r424898) +++ head/Mk/bsd.port.mk Sat Oct 29 10:10:33 2016 (r424899) @@ -1492,6 +1492,7 @@ QA_ENV+= STAGEDIR=${STAGEDIR} \ LDCONFIG_DIR="${LDCONFIG_DIR}" \ PKGORIGIN=${PKGORIGIN} \ LIB_RUN_DEPENDS='${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}' \ + UNIFIED_DEPENDS=${_UNIFIED_DEPENDS:C,([^:]*:[^:]*):?.*,\1,:O:u:Q} \ PKGBASE=${PKGBASE} .if !empty(USES:Mssl) QA_ENV+= USESSSL=yes