FreeBSD Bugzilla – Attachment 170556 Details for
Bug 195203
[stage-qa] bsd.port.mk: New check 'proxydeps': checks for the missing package dependencies
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
proxydeps.patch (text/plain), 7.80 KB, created by
Yuri Victorovich
on 2016-05-22 21:12:50 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Yuri Victorovich
Created:
2016-05-22 21:12:50 UTC
Size:
7.80 KB
patch
obsolete
>Index: Mk/Scripts/qa-proxydeps.sh >=================================================================== >--- Mk/Scripts/qa-proxydeps.sh (nonexistent) >+++ Mk/Scripts/qa-proxydeps.sh (working copy) >@@ -0,0 +1,154 @@ >+#!/bin/sh >+# MAINTAINER: portmgr@FreeBSD.org >+# $FreeBSD$ >+ >+# >+# This module finds shared objects that the port immediately depends on that >+# are not declared as immediate dependencies. >+# >+ >+listcontains() { >+ local str lst elt >+ str=$1 >+ lst=$2 >+ >+ for elt in ${lst} ; do >+ if [ ${elt} = ${str} ] ; then >+ return 0 >+ fi >+ done >+ return 1 >+} >+ >+list_staged_execs() { >+ # finds all dynamic executables which have dependencies that aren't within the >+ # declared set of dependencies in this port >+ find ${STAGEDIR} -type f \ >+ \( -perm -u+x -or -perm -g+x -or -perm -o+x \) \ >+ -and -exec /bin/sh -c "ldd {} > /dev/null 2>&1" \; \ >+ -and -exec echo {} \; >+} >+ >+list_immediate_deps() { >+ LD_LIBRARY_PATH=${LOCALBASE}/lib ldd -a "$1" | \ >+ awk 'BEGIN {section=0}; /^\// {section++} /^[^\/]/ {if(section<=1) print}' | \ >+ sed -e 's/.*=> //' -e 's/ .*//' >+} >+ >+pkg_to_origin() { >+ echo $(pkg info -o $1 | sed -E 's/^[^[:space:]]+[[:space:]]+//g') >+} >+ >+proxydeps_suggest_uses() { >+ local pkg=$1 >+ local lib_file=$2 >+ >+ # miscellaneous USE clauses >+ if expr ${pkg} : '^gettext-runtime' > /dev/null ; then >+ warn "you need USES+=gettext" >+ elif expr ${pkg} : '^glib-2' > /dev/null ; then >+ warn "you need USE_GNOME+=glib20" >+ elif expr ${pkg} : '^gdk-pixbuf2-' > /dev/null ; then >+ warn "you need USE_GNOME+=gdkpixbuf2" >+ elif expr ${pkg} : '^gtk2' > /dev/null ; then >+ warn "you need USE_GNOME+=gtk20" >+ elif expr ${pkg} : '^gtk3' > /dev/null ; then >+ warn "you need USE_GNOME+=gtk30" >+ elif expr ${pkg} : '^cairo-[0-9]' > /dev/null ; then >+ warn "you need USE_GNOME+=cairo" >+ elif expr ${pkg} : '^sqlite3' > /dev/null ; then >+ warn "you need USES+=sqlite" >+ # sdl-related >+ elif expr ${pkg} : '^sdl-1' > /dev/null ; then >+ warn "you need USE_SDL+=sdl" >+ elif echo ${pkg} | grep -E '^sdl_(console|gfx|image|mixer|mm|net|pango|sound|ttf)-' > /dev/null ; then >+ warn "you need USE_SDL+=$(echo ${pkg} | sed -E 's/^sdl_(.+)\-.*/\1/')" >+ elif expr ${pkg} : '^sdl2-2' > /dev/null ; then >+ warn "you need USE_SDL+=sdl2" >+ elif echo ${pkg} | grep -E '^sdl2_(gfx|image|mixer|net|ttf)-' > /dev/null ; then >+ warn "you need USE_SDL+=$(echo ${pkg} | sed -E 's/^sdl2_(.+)\-.*/\1/')2" >+ # gl-related >+ elif expr ${pkg} : 'libGL-[0-9]' > /dev/null ; then >+ warn "you need USE_GL+=gl" >+ elif expr ${pkg} : 'gbm-[0-9]' > /dev/null ; then >+ warn "you need USE_GL+=gbm" >+ elif expr ${pkg} : 'libglesv2-[0-9]' > /dev/null ; then >+ warn "you need USE_GL+=glesv2" >+ elif expr ${pkg} : '^libEGL-[0-9]' > /dev/null ; then >+ warn "you need USE_GL+=egl" >+ elif expr ${pkg} : '^glew-[0-9]' > /dev/null ; then >+ warn "you need USE_GL+=glew" >+ elif expr ${pkg} : '^libGLU-[0-9]' > /dev/null ; then >+ warn "you need USE_GL+=glu" >+ elif expr ${pkg} : '^libGLw-[0-9]' > /dev/null ; then >+ warn "you need USE_GL+=glw" >+ elif expr ${pkg} : '^freeglut-[0-9]' > /dev/null ; then >+ warn "you need USE_GL+=glut" >+ # Xorg-libraries: this should be by XORG_MODULES @ bsd.xorg.mk >+ elif echo ${pkg} | grep -E '^lib(X11|Xau|Xdmcp|Xext|SM|ICE|Xfixes|Xft|Xdamage|Xcomposite|Xcursor|Xinerama|Xmu|Xmuu|Xpm|Xt|Xtst|Xi|Xrandr|Xrender|Xres|XScrnSaver|Xv|Xxf86vm|Xxf86dga|Xxf86misc|xcb)-' > /dev/null ; then >+ warn "you need USE_XORG+=$(echo ${pkg} | sed -E 's/^lib(.+)\-.*/\1/' | tr '[:upper:]' '[:lower:]')" >+ elif expr ${pkg} : '^pixman-[0-9]' > /dev/null ; then >+ warn "you need USE_XORG+=pixman" >+ # Qt4 >+ elif echo ${pkg} | grep -E '^qt4-([a-z0-9]+)-[0-9]' > /dev/null ; then >+ warn "you need USE_QT4+=$(echo ${pkg} | sed -E 's/^qt4-([a-z0-9]+)-[0-9].*/\1/')" >+ # Qt5 >+ elif echo ${pkg} | grep -E '^qt5-([a-z]+)-[0-9]' > /dev/null ; then >+ warn "you need USE_QT5+=$(echo ${pkg} | sed -E 's/^qt5-([a-z]+)-[0-9].*/\1/')" >+ # MySQL >+ elif expr ${lib_file} : "${LOCALBASE}/lib/mysql/[^/]*$" > /dev/null ; then >+ warn "you need USES+=mysql" >+ # default >+ elif expr ${lib_file} : "${LOCALBASE}/lib/[^/]*$" > /dev/null ; then >+ lib_file=${lib_file#${LOCALBASE}/lib/} >+ lib_file=${lib_file%.so*}.so >+ warn "you need LIB_DEPENDS+=${lib_file}:$(pkg_to_origin ${pkg})" >+ fi >+} >+ >+subst_dep_file() { >+ local dep_file=$1 >+ if expr ${dep_file} : "${LOCALBASE}/lib/libGL.so.[0-9]$" > /dev/null ; then >+ if [ -f ${LOCALBASE}/lib/.mesa/libGL.so ] ; then >+ echo ${LOCALBASE}/lib/.mesa/libGL.so >+ return >+ fi >+ elif expr ${dep_file} : "${LOCALBASE}/lib/libEGL.so.[0-9]$" > /dev/null ; then >+ if [ -f ${LOCALBASE}/lib/.mesa/libEGL.so ] ; then >+ echo ${LOCALBASE}/lib/.mesa/libEGL.so >+ return >+ fi >+ fi >+ echo ${dep_file} >+} >+ >+proxydeps() { >+ local pkg="${PKG_NAME}" >+ local filelist="$(list_staged_execs)" >+ local deplist="${PKG_DEPS}" >+ >+ local file dep_file dep_file_pkg already pkg_dep_files >+ >+ # check for every dynamic executable >+ for file in ${filelist}; do >+ pkg_dep_files=$(list_immediate_deps "${file}") >+ for dep_file in $pkg_dep_files; do >+ dep_file=$(subst_dep_file ${dep_file}) >+ if listcontains ${dep_file} "${already}" ; then >+ continue >+ fi >+ if ! (expr "$dep_file" : '^/lib/' \| "$dep_file" : '^/usr/lib/' > /dev/null) ; then >+ if $(pkg which ${dep_file} > /dev/null 2>&1) ; then >+ dep_file_pkg=$(pkg which ${dep_file} | sed -e 's/.* installed by package //g') >+ if ! listcontains ${dep_file_pkg} "${deplist} ${pkg}" && [ $(pkg_to_origin ${dep_file_pkg}) != ${PKG_ORIGIN} ] ; then >+ warn "dependency file '${dep_file}' belongs to the package ${dep_file_pkg} which isn't declared as a dependency" >+ proxydeps_suggest_uses ${dep_file_pkg} ${dep_file} >+ fi >+ else >+ warn "dependency file '${dep_file}' doesn't belong to any package" >+ fi >+ fi >+ already="${already} ${dep_file}" >+ done >+ done >+} > >Property changes on: Mk/Scripts/qa-proxydeps.sh >___________________________________________________________________ >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:keywords >## -0,0 +1 ## >+FreeBSD=%H >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: Mk/Scripts/qa.sh >=================================================================== >--- Mk/Scripts/qa.sh (revision 415647) >+++ Mk/Scripts/qa.sh (working copy) >@@ -7,6 +7,19 @@ > exit 1 > fi > >+usage () { >+ echo "usage: $0 pkg-name pkg-origin pkg-deps" >+ exit 1 >+} >+ >+[ "$#" -eq 3 ] || usage >+ >+PKG_NAME=$1 >+PKG_ORIGIN=$2 >+PKG_DEPS=$3 >+ >+. /usr/ports/Mk/Scripts/qa-proxydeps.sh >+ > [ -n "${DEBUG_MK_SCRIPTS}" -o -n "${DEBUG_MK_SCRIPTS_QA}" ] && set -x > > LF=$(printf '\nX') >@@ -313,7 +326,7 @@ > return 0 > } > >-checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo suidfiles libtool libperl prefixvar baselibs terminfo" >+checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo suidfiles libtool libperl prefixvar baselibs terminfo proxydeps" > > ret=0 > cd ${STAGEDIR} >Index: Mk/bsd.port.mk >=================================================================== >--- Mk/bsd.port.mk (revision 415647) >+++ Mk/bsd.port.mk (working copy) >@@ -4590,6 +4590,11 @@ > done ; \ > ${SETENV} PKG_BIN="${PKG_BIN}" ${SH} ${SCRIPTSDIR}/actual-package-depends.sh $${depfiles} ${RUN_DEPENDS:C/(.*)\:.*/"\1"/} > >+ACTUAL-PACKAGE-DEPENDS-NAMES?= \ >+ if [ "${_LIB_RUN_DEPENDS}" != " " ]; then \ >+ ${PKG_QUERY} "%n-%v" " " ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,:C,${PORTSDIR}/,,} 2>/dev/null || : ; \ >+ fi >+ > create-manifest: > @${MKDIR} ${METADIR}; \ > (\ >@@ -5047,7 +5052,7 @@ > .if !target(stage-qa) > stage-qa: > @${ECHO_MSG} "====> Running Q/A tests (stage-qa)" >- @${SETENV} ${QA_ENV} ${SH} ${SCRIPTSDIR}/qa.sh >+ @${SETENV} ${QA_ENV} ${SH} ${SCRIPTSDIR}/qa.sh "${PKGBASE}-${PKGVERSION}" "${PKGORIGIN}" "`${ACTUAL-PACKAGE-DEPENDS-NAMES}`" > .if !defined(DEVELOPER) > @${ECHO_MSG} "/!\\ To run stage-qa automatically add DEVELOPER=yes to your environment /!\\" > .endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 195203
:
149628
|
149732
|
151513
|
170556
|
170557