aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorlifanov <lifanov@FreeBSD.org>2017-08-08 03:09:41 +0800
committerlifanov <lifanov@FreeBSD.org>2017-08-08 03:09:41 +0800
commit7d67a39637dc485b86730fb45dd08cb83742dc29 (patch)
tree333b1ccaaf195055c99d31292e6126848237ebbb /Mk
parent15bdeb21e89246946b6996dafdba4aab29c681e3 (diff)
downloadfreebsd-ports-gnome-7d67a39637dc485b86730fb45dd08cb83742dc29.tar.gz
freebsd-ports-gnome-7d67a39637dc485b86730fb45dd08cb83742dc29.tar.zst
freebsd-ports-gnome-7d67a39637dc485b86730fb45dd08cb83742dc29.zip
add new stage-qa target: gemdeps
This checks whether rubygem ports have all of their dependencies in gemspec satisfied by what's currently installed. Sample output: ====> Running Q/A tests (stage-qa) Error: RubyGem dependency archive-tar-minitar = 0.5.2 is not satisfied. *** Error code 1 Stop. make: stopped in /usr/home/lifanov/src/svn/freebsd/ports/head/archivers/rubygem-fpm These ports would be broken at runtime. Big thanks to: swills - discussion mat - reviews antoine - exp runs sunpoet - fixing several dozens of ports :) PR: 220605 Reviewed by: mat, sunpoet Approved by: portmgr (mat) Differential Revision: https://reviews.freebsd.org/D11841
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Scripts/qa.sh37
-rw-r--r--Mk/bsd.port.mk1
2 files changed, 37 insertions, 1 deletions
diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh
index b5a2880f599c..be506eab162f 100644
--- a/Mk/Scripts/qa.sh
+++ b/Mk/Scripts/qa.sh
@@ -830,10 +830,45 @@ no_arch() {
return $rc
}
+gemdeps()
+{
+ rc=0
+ if [ "${PKGBASE%%-*}" = "rubygem" ]; then
+ while read -r l; do
+ if [ -n "${l}" ]; then
+ name=${l%% *}
+ vers=${l#* }
+ while read -r v; do
+ if ! while read -r p; do
+ ${LOCALBASE}/bin/ruby -e "puts 'OK' if Gem::Dependency.new('${name}','${v}').match?('${name}','${p}')"
+ done | grep -qFx OK; then
+ err RubyGem dependency ${name} ${v} is not satisfied.
+ rc=1
+ fi <<-EOF
+ $(${LOCALBASE}/bin/gem list -e "${name}" \
+ | sed "s|.*(\(.*\))|\1|" \
+ | tr -d ' ' \
+ | tr , '\n')
+ EOF
+ done <<-EOF
+ $(while echo "${vers}" | grep -q '"'; do
+ echo "${vers}" | cut -d '"' -f2
+ vers=$(echo "${vers}"|cut -d '"' -f3-)
+ done)
+ EOF
+ fi
+ done <<-EOF
+ $(grep -a 'add_runtime_dependency' ${STAGEDIR}${PREFIX}/lib/ruby/gems/*/specifications/${PORTNAME}-*.gemspec \
+ | sed 's|.*<\(.*\)>.*\[\(.*\)\])|\1 \2|' \
+ | sort -u)
+ EOF
+ fi
+ return $rc
+}
checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo"
checks="$checks suidfiles libtool libperl prefixvar baselibs terminfo"
-checks="$checks proxydeps sonames perlcore no_arch"
+checks="$checks proxydeps sonames perlcore no_arch gemdeps"
ret=0
cd ${STAGEDIR}
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 42546f7f8578..75f19e58d60e 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1532,6 +1532,7 @@ QA_ENV+= STAGEDIR=${STAGEDIR} \
LIB_RUN_DEPENDS='${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}' \
UNIFIED_DEPENDS=${_UNIFIED_DEPENDS:C,([^:]*:[^:]*):?.*,\1,:O:u:Q} \
PKGBASE=${PKGBASE} \
+ PORTNAME=${PORTNAME} \
NO_ARCH=${NO_ARCH} \
"NO_ARCH_IGNORE=${NO_ARCH_IGNORE}"
.if !empty(USES:Mssl)