aboutsummaryrefslogtreecommitdiff
path: root/Mk/Scripts
diff options
context:
space:
mode:
authorTorsten Zuehlsdorff <tz@FreeBSD.org>2018-01-22 16:35:23 +0000
committerTorsten Zuehlsdorff <tz@FreeBSD.org>2018-01-22 16:35:23 +0000
commit2816b55780dedb51f4276fd0373975b6f80041b7 (patch)
treec3416ccad5fa3a08a254c968a7c1baf034bf43f5 /Mk/Scripts
parent859fd6a16c5e7be3faded9dc21ac47fa6a5316ee (diff)
Notes
Diffstat (limited to 'Mk/Scripts')
-rw-r--r--Mk/Scripts/qa.sh47
1 files changed, 46 insertions, 1 deletions
diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh
index 4ffb986fdb4e..4296c0b284ec 100644
--- a/Mk/Scripts/qa.sh
+++ b/Mk/Scripts/qa.sh
@@ -841,6 +841,51 @@ gemdeps()
return $rc
}
+# If an non rubygem-port has a 'Gemfile' file
+# it is checked with bundle to be sure
+# all dependencies are satisfied.
+# Without the check missing/wrong dependencies
+# are just found when executing the application
+gemfiledeps()
+{
+ # skip check if port does not use ruby at all
+ if [ -z "$USE_RUBY" ]; then
+ return 0
+ fi
+
+ # skip check if port is a rubygem-* one; they have no Gemfiles
+ if [ "${PKGBASE%%-*}" = "rubygem" ]; then
+ return 0
+ fi
+
+ # advise install of bundler if its not present for check
+ if ! type bundle > /dev/null 2>&1; then
+ notice "Please install sysutils/rubygem-bundler for additional Gemfile-checks"
+ return 0
+ fi
+
+ # locate the Gemfile(s)
+ while read -r f; do
+
+ # no results presents a blank line from heredoc
+ [ -z "$f" ] && continue
+
+ # if there is no Gemfile everything is fine - stop here
+ [ ! -f "$f" ] && return 0;
+
+ # use bundle to check if Gemfile is satisfied
+ # if bundle returns 1 the Gemfile is not satisfied
+ # and so stage-qa isn't also
+ if ! bundle check --dry-run --gemfile $f > /dev/null 2>&1; then
+ warn "Dependencies defined in ${f} are not satisfied"
+ fi
+
+ done <<-EOF
+ $(find ${STAGEDIR} -name Gemfile)
+ EOF
+ return 0
+}
+
flavors()
{
local rc pkgnames uniques
@@ -860,7 +905,7 @@ flavors()
checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo"
checks="$checks suidfiles libtool libperl prefixvar baselibs terminfo"
-checks="$checks proxydeps sonames perlcore no_arch gemdeps flavors"
+checks="$checks proxydeps sonames perlcore no_arch gemdeps gemfiledeps flavors"
ret=0
cd ${STAGEDIR}