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

Diff of /eclass/eutils.eclass

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

Revision 1.279 Revision 1.281
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2007 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/eutils.eclass,v 1.279 2007/04/25 09:14:35 carlo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.281 2007/06/05 15:59:26 nyhm Exp $
4# 4#
5# This eclass is for general purpose functions that most ebuilds 5# This eclass is for general purpose functions that most ebuilds
6# have to implement themselves. 6# have to implement themselves.
7# 7#
8# NB: If you add anything, please comment it! 8# NB: If you add anything, please comment it!
366 [[ -z ${T} ]] \ 366 [[ -z ${T} ]] \
367 && topdir="/tmp" \ 367 && topdir="/tmp" \
368 || topdir=${T} 368 || topdir=${T}
369 fi 369 fi
370 370
371 if [[ -z $(type -p mktemp) ]] ; then 371 if ! type -P mktemp > /dev/null ; then
372 # system lacks `mktemp` so we have to fake it
372 local tmp=/ 373 local tmp=/
373 while [[ -e ${tmp} ]] ; do 374 while [[ -e ${tmp} ]] ; do
374 tmp=${topdir}/tmp.${RANDOM}.${RANDOM}.${RANDOM} 375 tmp=${topdir}/tmp.${RANDOM}.${RANDOM}.${RANDOM}
375 done 376 done
376 ${exe} "${tmp}" || ${exe} -p "${tmp}" 377 ${exe} "${tmp}" || ${exe} -p "${tmp}"
377 echo "${tmp}" 378 echo "${tmp}"
378 else 379 else
380 # the args here will give slightly wierd names on BSD,
381 # but should produce a usable file on all userlands
379 if [[ ${exe} == "touch" ]] ; then 382 if [[ ${exe} == "touch" ]] ; then
380 [[ ${USERLAND} == "GNU" ]] \
381 && mktemp -p "${topdir}" \
382 || TMPDIR="${topdir}" mktemp -t tmp 383 TMPDIR="${topdir}" mktemp -t tmp.XXXXXXXXXX
383 else 384 else
384 [[ ${USERLAND} == "GNU" ]] \
385 && mktemp -d "${topdir}" \
386 || TMPDIR="${topdir}" mktemp -dt tmp 385 TMPDIR="${topdir}" mktemp -dt tmp.XXXXXXXXXX
387 fi 386 fi
388 fi 387 fi
389} 388}
390 389
391# Small wrapper for getent (Linux), nidump (Mac OS X), 390# Small wrapper for getent (Linux), nidump (Mac OS X),
1459 local dir=$(dirname ${cdset[${i}]}) 1458 local dir=$(dirname ${cdset[${i}]})
1460 local file=$(basename ${cdset[${i}]}) 1459 local file=$(basename ${cdset[${i}]})
1461 1460
1462 local point= node= fs= foo= 1461 local point= node= fs= foo=
1463 while read point node fs foo ; do 1462 while read point node fs foo ; do
1464 [[ " cd9660 iso9660 " != *" ${fs} "* ]] && \ 1463 [[ " cd9660 iso9660 udf " != *" ${fs} "* ]] && \
1465 ! [[ ${fs} == "subfs" && ",${opts}," == *",fs=cdfss,"* ]] \ 1464 ! [[ ${fs} == "subfs" && ",${opts}," == *",fs=cdfss,"* ]] \
1466 && continue 1465 && continue
1467 point=${point//\040/ } 1466 point=${point//\040/ }
1468 [[ -z $(find "${point}/${dir}" -maxdepth 1 -iname "${file}") ]] && continue 1467 [[ -z $(find "${point}/${dir}" -maxdepth 1 -iname "${file}") ]] && continue
1469 export CDROM_ROOT=${point} 1468 export CDROM_ROOT=${point}

Legend:
Removed from v.1.279  
changed lines
  Added in v.1.281

  ViewVC Help
Powered by ViewVC 1.1.20