/[gentoo-x86]/eclass/check-reqs.eclass
Gentoo

Diff of /eclass/check-reqs.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.11 Revision 1.13
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/check-reqs.eclass,v 1.11 2012/09/27 16:35:41 axs Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/check-reqs.eclass,v 1.13 2012/10/19 03:35:15 patrick Exp $
4 4
5# @ECLASS: check-reqs.eclass 5# @ECLASS: check-reqs.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# QA Team <qa@gentoo.org> 7# QA Team <qa@gentoo.org>
8# @AUTHOR: 8# @AUTHOR:
88# Exported function running the resources checks in pkg_setup phase. 88# Exported function running the resources checks in pkg_setup phase.
89# It should be run in both phases to ensure condition changes between 89# It should be run in both phases to ensure condition changes between
90# pkg_pretend and pkg_setup won't affect the build. 90# pkg_pretend and pkg_setup won't affect the build.
91check-reqs_pkg_setup() { 91check-reqs_pkg_setup() {
92 debug-print-function ${FUNCNAME} "$@" 92 debug-print-function ${FUNCNAME} "$@"
93
94 [[ ${MERGE_TYPE} == binary ]] && return
93 95
94 check-reqs_prepare 96 check-reqs_prepare
95 check-reqs_run 97 check-reqs_run
96 check-reqs_output 98 check-reqs_output
97} 99}
186 188
187 # Check for unset units and warn about them. 189 # Check for unset units and warn about them.
188 # Backcompat. 190 # Backcompat.
189 if [[ ${size} == ${1} ]]; then 191 if [[ ${size} == ${1} ]]; then
190 ewarn "QA: Package does not specify unit for the size check" 192 ewarn "QA: Package does not specify unit for the size check"
191 ewarn "QA: Assuming mebibytes." 193 ewarn "QA: Assuming megabytes."
192 ewarn "QA: File bug against the package. It should specify the unit." 194 ewarn "QA: File bug against the package. It should specify the unit."
193 fi 195 fi
194 196
195 echo ${size} 197 echo ${size}
196} 198}
205 [[ -z ${1} ]] && die "Usage: ${FUNCNAME} [size]" 207 [[ -z ${1} ]] && die "Usage: ${FUNCNAME} [size]"
206 208
207 local unit=${1:(-1)} 209 local unit=${1:(-1)}
208 210
209 case ${unit} in 211 case ${unit} in
210 G) echo "gibibytes" ;; 212 G) echo "gigabytes" ;;
211 [M0-9]) echo "mebibytes" ;; 213 [M0-9]) echo "megabytes" ;;
212 T) echo "tebibytes" ;; 214 T) echo "terabytes" ;;
213 *) 215 *)
214 die "${FUNCNAME}: Unknown unit: ${unit}" 216 die "${FUNCNAME}: Unknown unit: ${unit}"
215 ;; 217 ;;
216 esac 218 esac
217} 219}

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.20