Date: Thu, 22 Jan 2015 00:05:58 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-projects@freebsd.org Subject: svn commit: r377637 - in projects/rework-dependency-registration/Mk: . Scripts Message-ID: <201501220005.t0M05wvr017220@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Thu Jan 22 00:05:58 2015 New Revision: 377637 URL: https://svnweb.freebsd.org/changeset/ports/377637 QAT: https://qat.redports.org/buildarchive/r377637/ Log: Register dependencies base on the pattern provided on depends rather than on origin Added: projects/rework-dependency-registration/Mk/Scripts/actual-package-depends.sh (contents, props changed) Modified: projects/rework-dependency-registration/Mk/bsd.port.mk Added: projects/rework-dependency-registration/Mk/Scripts/actual-package-depends.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/rework-dependency-registration/Mk/Scripts/actual-package-depends.sh Thu Jan 22 00:05:58 2015 (r377637) @@ -0,0 +1,29 @@ +#!/bin/sh +# MAINTAINER: portmgr@FeeeBSD.org +# $FreeBSD$ + +if [ -z "${PKG_BIN}" -o -z "${SCRIPTSDIR}" ]; then + echo "PKG_BIN, SCRIPTSDIR required in environment." >&2 + exit 1 +fi + +find_dep() { + pattern=$1 + case ${pattern} in + *\>*|*\<*|*=*) + ${PKG_BIN} info -Eg "${pattern}" 2>/dev/null + return + ;; + /*) + searchfile=$pattern + ;; + *) + searchfile=$(/usr/bin/which ${pattern} 2>/dev/null) + ;; + esac + [ -n "${searchfile}" ] && ${PKG_BIN} which -q ${searchfile} +} + +for lookup; do + ${PKG_BIN} query "\"%n\": {origin: \"%o\", version: \"%v\"}" $(find_dep ${lookup}) || : +done Modified: projects/rework-dependency-registration/Mk/bsd.port.mk ============================================================================== --- projects/rework-dependency-registration/Mk/bsd.port.mk Wed Jan 21 23:47:28 2015 (r377636) +++ projects/rework-dependency-registration/Mk/bsd.port.mk Thu Jan 22 00:05:58 2015 (r377637) @@ -4791,9 +4791,11 @@ PACKAGE-DEPENDS-LIST?= \ done ACTUAL-PACKAGE-DEPENDS?= \ - if [ "${_LIB_RUN_DEPENDS}" != " " ]; then \ - ${PKG_QUERY} "\"%n\": {origin: %o, version: \"%v\"}" " " ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,:C,${PORTSDIR}/,,} 2>/dev/null || : ; \ - fi + depfiles="" ; \ + for lib in ${LIB_DEPENDS:C/\:.*//}; do \ + depfiles="$$depfiles `LIB_DIRS="${LIB_DIRS}" LOCALBASE="${LOCALBASE}" ${SH} ${SCRIPTSDIR}/find-lib.sh $${lib}`" ; \ + done ; \ + ${SETENV} SCRIPTSDIR="${SCRIPTSDIR}" PKG_BIN="${PKG_BIN}" ${SH} ${SCRIPTSDIR}/actual-package-depends.sh $${depfiles} ${RUN_DEPENDS:C/(.*)\:.*/"\1"/} create-manifest: @${MKDIR} ${METADIR}; \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501220005.t0M05wvr017220>