summaryrefslogtreecommitdiff
path: root/misc/rubygems
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2008-03-27 05:29:42 +0000
committerjlam <jlam@pkgsrc.org>2008-03-27 05:29:42 +0000
commitfa183dde4f444bf85af4a76eb116fd20957fa183 (patch)
treeb1a32cd7cccc85eff7e55c264190fdd732672d4f /misc/rubygems
parent39856cea18f0d8974f2f0728dcd1b05f60ae6692 (diff)
downloadpkgsrc-fa183dde4f444bf85af4a76eb116fd20957fa183.tar.gz
The ``gem'' command doesn't exit with an error if the install fails.
Manually check that the installation actually succeeds or exit with an error so that the pkgsrc make process halts with the proper error code. Suggestion for change by <seb> in private email.
Diffstat (limited to 'misc/rubygems')
-rw-r--r--misc/rubygems/rubygem.mk15
1 files changed, 14 insertions, 1 deletions
diff --git a/misc/rubygems/rubygem.mk b/misc/rubygems/rubygem.mk
index fcc3f75859c..85df4604c47 100644
--- a/misc/rubygems/rubygem.mk
+++ b/misc/rubygems/rubygem.mk
@@ -1,4 +1,4 @@
-# $NetBSD: rubygem.mk,v 1.32 2008/03/24 18:48:54 jlam Exp $
+# $NetBSD: rubygem.mk,v 1.33 2008/03/27 05:29:42 jlam Exp $
#
# This Makefile fragment is intended to be included by packages that build
# and install Ruby gems.
@@ -112,6 +112,7 @@ GEM_HOME= ${PREFIX}/lib/ruby/gems/${RUBY_VER_DIR}
GEM_NAME?= ${DISTNAME}
GEM_LIBDIR= ${GEM_HOME}/gems/${GEM_NAME}
GEM_DOCDIR= ${GEM_HOME}/doc/${GEM_NAME}
+GEM_CACHEDIR= ${GEM_HOME}/cache
# Installed gems have wrapper scripts that call the right interpreter,
# regardless of the #! line at the head of a script, so we can skip
@@ -199,6 +200,7 @@ PKG_FAIL_REASON= "GEM_CLEANBUILD must be relative to "${GEM_LIBDIR:Q}"."
_GEM_BUILD_TARGETS= _gem-${GEM_BUILD}-build
_GEM_BUILD_TARGETS+= _gem-build-buildroot
+_GEM_BUILD_TARGETS+= _gem-build-buildroot-check
.if !empty(GEM_CLEANBUILD)
_GEM_BUILD_TARGETS+= _gem-build-cleanbuild
.endif
@@ -213,6 +215,8 @@ gem-build: ${_GEM_BUILD_TARGETS}
_gem-gemspec-build:
${RUN} cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
${RUBYGEM} build ${GEM_SPECFILE}
+ ${RUN} test -f ${WRKSRC}/${GEM_NAME}.gem || \
+ ${FAIL_MSG} "Build of ${GEM_NAME}.gem failed."
BUILD_TARGET?= gem
@@ -238,6 +242,15 @@ _gem-build-buildroot:
@${STEP_MSG} "Installing gem into buildroot"
${RUN} ${SETENV} ${MAKE_ENV} ${RUBYGEM} install ${_RUBYGEM_OPTIONS}
+# The ``gem'' command doesn't exit with a non-zero result even if the
+# install of the gem failed, so we do the check and return the proper exit
+# code ourselves.
+#
+.PHONY: _gem-build-buildroot-check
+_gem-build-buildroot-check:
+ ${RUN} test -f ${_RUBYGEM_BUILDROOT}${GEM_CACHE}/${GEM_NAME}.gem || \
+ ${FAIL_MSG} "Installing ${GEM_NAME}.gem into buildroot failed."
+
.if !empty(GEM_CLEANBUILD)
.PHONY: _gem-build-cleanbuild
_gem-build-cleanbuild: