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

Diff of /eclass/eutils.eclass

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

Revision 1.256 Revision 1.263
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 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.256 2006/10/31 19:29:12 agriffis Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.263 2006/11/13 20:58:41 vapier 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!
755# Simple script to replace 'dos2unix' binaries 755# Simple script to replace 'dos2unix' binaries
756# vapier@gentoo.org 756# vapier@gentoo.org
757# 757#
758# edos2unix(file, <more files> ...) 758# edos2unix(file, <more files> ...)
759edos2unix() { 759edos2unix() {
760 for f in "$@" 760 echo "$@" | xargs sed -i 's/\r$//'
761 do
762 cp "${f}" ${T}/edos2unix
763 sed 's/\r$//' ${T}/edos2unix > "${f}"
764 done
765} 761}
766 762
767 763
768############################################################## 764##############################################################
769# START: Handle .desktop files and menu entries # 765# START: Handle .desktop files and menu entries #
1163 # lets grab the first few bytes of the file to figure out what kind of archive it is 1159 # lets grab the first few bytes of the file to figure out what kind of archive it is
1164 local tmpfile="$(emktemp)" 1160 local tmpfile="$(emktemp)"
1165 eval ${exe} 2>/dev/null | head -c 512 > "${tmpfile}" 1161 eval ${exe} 2>/dev/null | head -c 512 > "${tmpfile}"
1166 local filetype="$(file -b "${tmpfile}")" 1162 local filetype="$(file -b "${tmpfile}")"
1167 case ${filetype} in 1163 case ${filetype} in
1168 *tar\ archive) 1164 *tar\ archive*)
1169 eval ${exe} | tar --no-same-owner -xf - 1165 eval ${exe} | tar --no-same-owner -xf -
1170 ;; 1166 ;;
1171 bzip2*) 1167 bzip2*)
1172 eval ${exe} | bzip2 -dc | tar --no-same-owner -xf - 1168 eval ${exe} | bzip2 -dc | tar --no-same-owner -xf -
1173 ;; 1169 ;;
1402 1398
1403 while [[ -n ${cdset[${i}]} ]] ; do 1399 while [[ -n ${cdset[${i}]} ]] ; do
1404 local dir=$(dirname ${cdset[${i}]}) 1400 local dir=$(dirname ${cdset[${i}]})
1405 local file=$(basename ${cdset[${i}]}) 1401 local file=$(basename ${cdset[${i}]})
1406 1402
1407 for mline in $(mount | gawk '/(iso|cdrom|fs=cdfss)/ {print $3}') ; do 1403 local point= node= fs= foo=
1408 [[ -d ${mline}/${dir} ]] || continue 1404 while read point node fs foo ; do
1405 [[ *" ${fs} "* != " cd9660 iso9660 " ]] && continue
1406 point=${point//\040/ }
1409 if [[ -n $(find ${mline}/${dir} -maxdepth 1 -iname ${file}) ]] ; then 1407 [[ -z $(find "${point}/${dir}" -maxdepth 1 -iname "${file}") ]] && continue
1410 export CDROM_ROOT=${mline} 1408 export CDROM_ROOT=${point}
1411 export CDROM_SET=${i} 1409 export CDROM_SET=${i}
1412 export CDROM_MATCH=${cdset[${i}]} 1410 export CDROM_MATCH=${cdset[${i}]}
1413 return 1411 return
1414 fi 1412 done <<< "$(get_mounts)"
1415 done
1416 1413
1417 ((++i)) 1414 ((++i))
1418 done 1415 done
1419 1416
1420 echo 1417 echo

Legend:
Removed from v.1.256  
changed lines
  Added in v.1.263

  ViewVC Help
Powered by ViewVC 1.1.20