public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] RFC: small update for check-reqs.eclass
@ 2014-03-27 22:46 Ulrich Mueller
  0 siblings, 0 replies; only message in thread
From: Ulrich Mueller @ 2014-03-27 22:46 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1696 bytes --]

The current test for MERGE_TYPE in check-reqs_pkg_setup suppresses
also the CHECKREQS_DISK_{USR,VAR} checks which are relevant for binary
installs. Move the test to check-reqs_run().

Also, don't check install disk space requirements if building a binpkg
without installing it.


--- check-reqs.eclass	19 Oct 2012 03:35:15 -0000	1.13
+++ check-reqs.eclass	27 Mar 2014 22:27:27 -0000
@@ -91,8 +91,6 @@
 check-reqs_pkg_setup() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	[[ ${MERGE_TYPE} == binary ]] && return
-
 	check-reqs_prepare
 	check-reqs_run
 	check-reqs_output
@@ -132,24 +130,29 @@
 	# some people are *censored*
 	unset CHECKREQS_FAILED
 
-	[[ -n ${CHECKREQS_MEMORY} ]] && \
-		check-reqs_memory \
-			${CHECKREQS_MEMORY}
-
-	[[ -n ${CHECKREQS_DISK_BUILD} ]] && \
-		check-reqs_disk \
-			"${T}" \
-			"${CHECKREQS_DISK_BUILD}"
-
-	[[ -n ${CHECKREQS_DISK_USR} ]] && \
-		check-reqs_disk \
-			"${EROOT}/usr" \
-			"${CHECKREQS_DISK_USR}"
-
-	[[ -n ${CHECKREQS_DISK_VAR} ]] && \
-		check-reqs_disk \
-			"${EROOT}/var" \
-			"${CHECKREQS_DISK_VAR}"
+			# use != in test, because MERGE_TYPE only exists in EAPI 4 and later
+	if [[ ${MERGE_TYPE} != binary ]]; then
+		[[ -n ${CHECKREQS_MEMORY} ]] && \
+			check-reqs_memory \
+				${CHECKREQS_MEMORY}
+
+		[[ -n ${CHECKREQS_DISK_BUILD} ]] && \
+			check-reqs_disk \
+				"${T}" \
+				"${CHECKREQS_DISK_BUILD}"
+	fi
+
+	if [[ ${MERGE_TYPE} != buildonly ]]; then
+		[[ -n ${CHECKREQS_DISK_USR} ]] && \
+			check-reqs_disk \
+				"${EROOT}/usr" \
+				"${CHECKREQS_DISK_USR}"
+
+		[[ -n ${CHECKREQS_DISK_VAR} ]] && \
+			check-reqs_disk \
+				"${EROOT}/var" \
+				"${CHECKREQS_DISK_VAR}"
+	fi
 }
 
 # @FUNCTION: check-reqs_get_mebibytes

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-03-27 22:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-27 22:46 [gentoo-dev] RFC: small update for check-reqs.eclass Ulrich Mueller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox