/[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.4 Revision 1.5
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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.4 2005/07/06 20:23:20 agriffis Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/check-reqs.eclass,v 1.5 2006/02/15 12:51:25 ciaranm Exp $
4# 4#
5# Original Author: Ciaran McCreesh <ciaranm@gentoo.org> 5# Original Author: Ciaran McCreesh <ciaranm@gentoo.org>
6# 6#
7# This eclass provides a uniform way of handling ebuilds which have very high 7# This eclass provides a uniform way of handling ebuilds which have very high
8# build requirements in terms of memory or disc space. It provides a function 8# build requirements in terms of memory or disc space. It provides a function
36# CHECKREQS_DISK_VAR="1024" 36# CHECKREQS_DISK_VAR="1024"
37# 37#
38# # go! 38# # go!
39# check_reqs 39# check_reqs
40# } 40# }
41#
42# Alternatively, the check_reqs_conditional function can be used to carry out
43# alternate actions (e.g. using a much slower but far less memory intensive
44# build option that gives the same end result).
41# 45#
42# You should *not* override the user's CHECKREQS_ACTION setting, nor should you 46# You should *not* override the user's CHECKREQS_ACTION setting, nor should you
43# attempt to provide a value if it is unset. Note that the environment variables 47# attempt to provide a value if it is unset. Note that the environment variables
44# are used rather than parameters for a few reasons: 48# are used rather than parameters for a few reasons:
45# * easier to do if use blah ; then things 49# * easier to do if use blah ; then things
80 84
81 if [ -n "${CHECKREQS_NEED_DIE}" ] ; then 85 if [ -n "${CHECKREQS_NEED_DIE}" ] ; then
82 eerror "Bailing out as specified by CHECKREQS_ACTION" 86 eerror "Bailing out as specified by CHECKREQS_ACTION"
83 die "Build requirements not met" 87 die "Build requirements not met"
84 fi 88 fi
89}
90
91check_reqs_conditional() {
92 [ -n "$1" ] && die "Usage: check_reqs"
93
94 export CHECKREQS_NEED_SLEEP="" CHECKREQS_NEED_DIE=""
95 if [ "$CHECKREQS_ACTION" != "ignore" ] ; then
96 [ -n "$CHECKREQS_MEMORY" ] && check_build_memory
97 [ -n "$CHECKREQS_DISK_BUILD" ] && check_build_disk \
98 "${PORTAGE_TMPDIR}" "\${PORTAGE_TMPDIR}" "${CHECKREQS_DISK_BUILD}"
99 [ -n "$CHECKREQS_DISK_USR" ] && check_build_disk \
100 "${ROOT}/usr" "\${ROOT}/usr" "${CHECKREQS_DISK_USR}"
101 [ -n "$CHECKREQS_DISK_VAR" ] && check_build_disk \
102 "${ROOT}/var" "\${ROOT}/var" "${CHECKREQS_DISK_VAR}"
103 fi
104
105 [ -z "${CHECKREQS_NEED_SLEEP}" ] && [ -z "${CHECKREQS_NEED_DIE}" ]
85} 106}
86 107
87# internal use only! 108# internal use only!
88check_build_memory() { 109check_build_memory() {
89 [ -n "$1" ] && die "Usage: check_build_memory" 110 [ -n "$1" ] && die "Usage: check_build_memory"

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20