/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

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

Revision 1.15 Revision 1.19
1# Copyright 1999-2002 Gentoo Technologies, Inc. 1# Copyright 1999-2003 Gentoo Technologies, Inc.
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/eutils.eclass,v 1.19 2003/02/16 20:12:26 azarah Exp $
4#
3# Author: Martin Schlemmer <azarah@gentoo.org> 5# Author: Martin Schlemmer <azarah@gentoo.org>
4# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.15 2003/02/02 19:43:33 azarah Exp $ 6#
5# This eclass is for general purpose functions that most ebuilds 7# This eclass is for general purpose functions that most ebuilds
6# have to implement themselves. 8# have to implement themselves.
7# 9#
8# NB: If you add anything, please comment it! 10# NB: If you add anything, please comment it!
9 11
153 then 155 then
154 local EPATCH_SOURCE="$1/*.${EPATCH_SUFFIX}" 156 local EPATCH_SOURCE="$1/*.${EPATCH_SUFFIX}"
155 else 157 else
156 if [ ! -d ${EPATCH_SOURCE} ] 158 if [ ! -d ${EPATCH_SOURCE} ]
157 then 159 then
160 if [ -n "$1" -a "${EPATCH_SOURCE}" = "${WORKDIR}/patch" ]
161 then
162 EPATCH_SOURCE="$1"
163 fi
164
158 echo 165 echo
159 eerror "Cannot find \$EPATCH_SOURCE! Value for \$EPATCH_SOURCE is:" 166 eerror "Cannot find \$EPATCH_SOURCE! Value for \$EPATCH_SOURCE is:"
160 eerror 167 eerror
161 eerror " ${EPATCH_SOURCE}" 168 eerror " ${EPATCH_SOURCE}"
162 echo 169 echo
255 count=5 262 count=5
256 break 263 break
257 fi 264 fi
258 fi 265 fi
259 266
260 if patch ${popts} --dry-run -f -p${count} < ${PATCH_TARGET} >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 2>&1 267 if (cat ${PATCH_TARGET} | patch ${popts} --dry-run -f -p${count}) >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 2>&1
261 then 268 then
262 draw_line "***** ${x##*/} *****" > ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 269 draw_line "***** ${x##*/} *****" > ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real
263 echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 270 echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real
264 echo "ACTUALLY APPLYING ${x##*/}..." >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 271 echo "ACTUALLY APPLYING ${x##*/}..." >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real
265 echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 272 echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real
266 draw_line "***** ${x##*/} *****" >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 273 draw_line "***** ${x##*/} *****" >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real
267 274
268 patch ${popts} -p${count} < ${PATCH_TARGET} >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 2>&1 275 cat ${PATCH_TARGET} | patch ${popts} -p${count} >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 2>&1
269 276
270 if [ "$?" -ne 0 ] 277 if [ "$?" -ne 0 ]
271 then 278 then
272 cat ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 279 cat ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}
273 echo 280 echo
328 335
329 # This bit is from H?kan Wessberg <nacka-gentoo@refug.org>, bug #13565. 336 # This bit is from H?kan Wessberg <nacka-gentoo@refug.org>, bug #13565.
330 if [ "`egrep "^[[:space:]]*MAKEOPTS=" /etc/make.conf | wc -l`" -gt 0 ] 337 if [ "`egrep "^[[:space:]]*MAKEOPTS=" /etc/make.conf | wc -l`" -gt 0 ]
331 then 338 then
332 ADMINOPTS="`egrep "^[[:space:]]*MAKEOPTS=" /etc/make.conf | cut -d= -f2 | sed 's/\"//g'`" 339 ADMINOPTS="`egrep "^[[:space:]]*MAKEOPTS=" /etc/make.conf | cut -d= -f2 | sed 's/\"//g'`"
333 ADMINPARAM="${ADMINOPTS##*-j}" 340 ADMINPARAM="`echo ${ADMINOPTS} | gawk '{match($0, /-j *[0-9]*/, opt); print opt[0]}'`"
334 ADMINPARAM="${ADMINPARAM%% -*}" 341 ADMINPARAM="${ADMINPARAM/-j}"
335 fi 342 fi
336 343
337 export MAKEOPTS="`echo ${MAKEOPTS} | sed -e 's:-j[0-9]*::g'`" 344 export MAKEOPTS="`echo ${MAKEOPTS} | sed -e 's:-j *[0-9]*::g'`"
338 345
339 if [ "${ARCH}" = "x86" ] 346 if [ "${ARCH}" = "x86" -o "${ARCH}" = "hppa" ]
340 then 347 then
341 # x86 always has "processor" 348 # x86 and hppa always has "processor"
342 jobs="$((`grep -c ^processor /proc/cpuinfo` * 2))" 349 jobs="$((`grep -c ^processor /proc/cpuinfo` * 2))"
343 350
344 elif [ "${ARCH}" = "sparc" -o "${ARCH}" = "sparc64" ] 351 elif [ "${ARCH}" = "sparc" -o "${ARCH}" = "sparc64" ]
345 then 352 then
346 # sparc always has "ncpus active" 353 # sparc always has "ncpus active"

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.20