Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Oct 2016 13:39:36 +0300
From:      Andrej Zverev <andrej.zverev@gmail.com>
To:        Mathieu Arnold <mat@freebsd.org>
Cc:        "ports-committers@freebsd.org" <ports-committers@freebsd.org>,  "svn-ports-all@freebsd.org" <svn-ports-all@freebsd.org>,  "svn-ports-head@freebsd.org" <svn-ports-head@freebsd.org>
Subject:   Re: svn commit: r424899 - in head/Mk: . Scripts
Message-ID:  <CAD5bB%2BgTRmzbLVfE1n9i=Cu%2ByMp0cRb6CgZm6=QJfe%2BwPA%2BFfg@mail.gmail.com>
In-Reply-To: <201610291010.u9TAAXAW028570@repo.freebsd.org>
References:  <201610291010.u9TAAXAW028570@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Nice! Thank you.

On Sat, Oct 29, 2016 at 1:10 PM, Mathieu Arnold <mat@freebsd.org> wrote:

> 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
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAD5bB%2BgTRmzbLVfE1n9i=Cu%2ByMp0cRb6CgZm6=QJfe%2BwPA%2BFfg>