From d3aec1c719a07ca3e1ecb4a4e606a643b3b28733 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 10 Nov 2006 15:56:59 +0000 Subject: [PATCH] get_mounts now returns mount options too --- eclass/eutils.eclass | 22 +++++++++++----------- eclass/portability.eclass | 14 ++++++++------ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 91f24feb75da..fcb6a5d2be5c 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # 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. @@ -1404,16 +1404,16 @@ _cdrom_locate_file_on_cd() { 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 diff --git a/eclass/portability.eclass b/eclass/portability.eclass index f8d0a12f1d75..c198218083ee 100644 --- a/eclass/portability.eclass +++ b/eclass/portability.eclass @@ -1,6 +1,6 @@ # 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ò # @@ -131,15 +131,15 @@ get_bmake() { } # 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 @@ -153,7 +153,9 @@ get_mounts() { # 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 } -- 2.26.2