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

Diff of /eclass/multilib.eclass

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

Revision 1.5 Revision 1.8
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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/multilib.eclass,v 1.5 2005/01/12 22:39:44 eradicator Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.8 2005/01/13 19:30:41 vapier Exp $
4# 4#
5# Author: Jeremy Huddleston <eradicator@gentoo.org> 5# Author: Jeremy Huddleston <eradicator@gentoo.org>
6# 6#
7# This eclass is for all functions pertaining to handling multilib. 7# This eclass is for all functions pertaining to handling multilib.
8# configurations. 8# configurations.
9 9
10ECLASS=multilib 10ECLASS=multilib
11INHERITED="$INHERITED $ECLASS" 11INHERITED="$INHERITED $ECLASS"
12 12
13DESCRIPTION="Based on the ${ECLASS} eclass" 13DESCRIPTION="Based on the ${ECLASS} eclass"
14
15DEPEND="!build? ( sys-apps/sed sys-apps/findutils sys-apps/coreutils )"
16 14
17# This function simply returns the desired lib directory. With portage 15# This function simply returns the desired lib directory. With portage
18# 2.0.51, we now have support for installing libraries to lib32/lib64 16# 2.0.51, we now have support for installing libraries to lib32/lib64
19# to accomidate the needs of multilib systems. It's no longer a good idea 17# to accomidate the needs of multilib systems. It's no longer a good idea
20# to assume all libraries will end up in lib. Replace any (sane) instances 18# to assume all libraries will end up in lib. Replace any (sane) instances
294 292
295# Helper function for create_ml_includes 293# Helper function for create_ml_includes
296create_ml_includes-tidy_path() { 294create_ml_includes-tidy_path() {
297 local removed="${1}" 295 local removed="${1}"
298 296
299 if [ -n "${1}" ]; then 297 if [ -n "${removed}" ]; then
300 # Remove multiple slashes 298 # Remove multiple slashes
301 while [ "${removed}" != "${removed/\/\//\/}" ]; do 299 while [ "${removed}" != "${removed/\/\//\/}" ]; do
302 removed=${removed/\/\//\/} 300 removed=${removed/\/\//\/}
303 done 301 done
304 302
307 removed=${removed//\/.\//\/} 305 removed=${removed//\/.\//\/}
308 done 306 done
309 [ "${removed##*/}" = "." ] && removed=${removed%/*} 307 [ "${removed##*/}" = "." ] && removed=${removed%/*}
310 308
311 # Removed .. directories 309 # Removed .. directories
312 # I wonder if there's a non-trivial bashism for this one... 310 while [ "${removed}" != "${removed//\/..\/}" ]; do
313 while [ "${removed}" != "$(echo ${removed} | sed -e 's:[^/]*/\.\./::')" ]; do 311 local p1="${removed%%\/..\/*}"
314 removed=$(echo ${removed} | sed -e 's:[^/]*/\.\./::') 312 local p2="${removed#*\/..\/}"
313
314 removed="${p1%\/*}/${p2}"
315 done 315 done
316 316
317 # Remove trailing .. 317 # Remove trailing ..
318 removed=$(echo ${removed} | sed -e 's:/[^/]*/\.\.$::') 318 [ "${removed##*/}" = ".." ] && removed=${removed%/*/*}
319 319
320 # Remove trailing / 320 # Remove trailing /
321 [ "${removed##*/}" = "" ] && removed=${removed%/*} 321 [ "${removed##*/}" = "" ] && removed=${removed%/*}
322 322
323 echo ${removed} 323 echo ${removed}
353 353
354# Helper function for create_ml_includes 354# Helper function for create_ml_includes
355create_ml_includes-allfiles() { 355create_ml_includes-allfiles() {
356 local basedirs=${@} 356 local basedirs=${@}
357 357
358 local files 358 local basedir
359 for basedir in ${basedirs}; do 359 for basedir in ${basedirs}; do
360 local file 360 local file
361 for file in $(find ${D}/${basedir} -type f); do 361 for file in $(find ${D}/${basedir} -type f); do
362 echo ${file/${D}\/${basedir}\//} 362 echo ${file/${D}\/${basedir}\//}
363 done 363 done
373 if [ "${dir}" = "${data/*:/}" ]; then 373 if [ "${dir}" = "${data/*:/}" ]; then
374 echo ${data/:*/} 374 echo ${data/:*/}
375 return 0 375 return 0
376 fi 376 fi
377 done 377 done
378 echo "Should be here -- create_ml_includes-sym_for_dir ${1} ${@}" 378 echo "Shouldn't be here -- create_ml_includes-sym_for_dir ${1} ${@}"
379 # exit because we'll likely be called from a subshell 379 # exit because we'll likely be called from a subshell
380 exit 1 380 exit 1
381} 381}

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20