# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.258 2006/11/02 21:13:47 nyhm Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.259 2006/11/10 15:56:58 uberlord Exp $
#
# This eclass is for general purpose functions that most ebuilds
# have to implement themselves.
local dir=$(dirname ${cdset[${i}]})
local file=$(basename ${cdset[${i}]})
- for mline in $(gawk '/(iso|cdrom|fs=cdfss)/ {print $2}' /proc/mounts) ; do
- mline=$(echo -e ${mline})
- [[ -d ${mline}/${dir} ]] || continue
- if [[ -n $(find "${mline}"/${dir} -maxdepth 1 -iname ${file}) ]] ; then
- export CDROM_ROOT=${mline}
- export CDROM_SET=${i}
- export CDROM_MATCH=${cdset[${i}]}
- return
- fi
- done
+ local point= node= fs= foo=
+ while read point node fs foo ; do
+ [[ *" ${fs} "* != " cd9660 iso9660 " ]] && continue
+ point=${point//\040/ }
+ [[ -z $(find "${point}/${dir}" -maxdepth 1 -iname "${file}") ]] && continue
+ export CDROM_ROOT=${point}
+ export CDROM_SET=${i}
+ export CDROM_MATCH=${cdset[${i}]}
+ return
+ done < <(get_mounts)
((++i))
done
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/portability.eclass,v 1.9 2006/11/06 13:55:04 uberlord Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/portability.eclass,v 1.10 2006/11/10 15:56:59 uberlord Exp $
#
# Author: Diego Pettenò <flameeyes@gentoo.org>
#
}
# Portable method of getting mount names and points.
-# Returns as "point node fs"
+# Returns as "point node fs options"
# Remember to convert 040 back to a space.
get_mounts() {
- local point= node= fs= foo=
+ local point= node= fs= opts= foo=
# Linux has /proc/mounts which should always exist
if [[ $(uname -s) == "Linux" ]] ; then
- while read node point fs foo ; do
- echo "${point} ${node} ${fs}"
+ while read node point fs opts foo ; do
+ echo "${point} ${node} ${fs} ${opts}"
done < /proc/mounts
return
fi
# of the spaces and we should not force a /proc either.
local IFS=$'\t'
LC_ALL=C mount -p | while read node point fs foo ; do
- echo "${point// /\040} ${node// /\040} ${fs%% *}"
+ opts=${fs#* }
+ fs=${fs%% *}
+ echo "${point// /\040} ${node// /\040} ${fs%% *} ${opts// /\040}"
done
}