/[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.7
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.7 2005/01/13 00:48:39 eradicator 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.
294 294
295# Helper function for create_ml_includes 295# Helper function for create_ml_includes
296create_ml_includes-tidy_path() { 296create_ml_includes-tidy_path() {
297 local removed="${1}" 297 local removed="${1}"
298 298
299 if [ -n "${1}" ]; then 299 if [ -n "${removed}" ]; then
300 # Remove multiple slashes 300 # Remove multiple slashes
301 while [ "${removed}" != "${removed/\/\//\/}" ]; do 301 while [ "${removed}" != "${removed/\/\//\/}" ]; do
302 removed=${removed/\/\//\/} 302 removed=${removed/\/\//\/}
303 done 303 done
304 304
307 removed=${removed//\/.\//\/} 307 removed=${removed//\/.\//\/}
308 done 308 done
309 [ "${removed##*/}" = "." ] && removed=${removed%/*} 309 [ "${removed##*/}" = "." ] && removed=${removed%/*}
310 310
311 # Removed .. directories 311 # Removed .. directories
312 # I wonder if there's a non-trivial bashism for this one... 312 while [ "${removed}" != "${removed//\/..\/}" ]; do
313 while [ "${removed}" != "$(echo ${removed} | sed -e 's:[^/]*/\.\./::')" ]; do 313 local p1="${removed%%\/..\/*}"
314 removed=$(echo ${removed} | sed -e 's:[^/]*/\.\./::') 314 local p2="${removed#*\/..\/}"
315
316 removed="${p1%\/*}/${p2}"
315 done 317 done
316 318
317 # Remove trailing .. 319 # Remove trailing ..
318 removed=$(echo ${removed} | sed -e 's:/[^/]*/\.\.$::') 320 [ "${removed##*/}" = ".." ] && removed=${removed%/*/*}
319 321
320 # Remove trailing / 322 # Remove trailing /
321 [ "${removed##*/}" = "" ] && removed=${removed%/*} 323 [ "${removed##*/}" = "" ] && removed=${removed%/*}
322 324
323 echo ${removed} 325 echo ${removed}
353 355
354# Helper function for create_ml_includes 356# Helper function for create_ml_includes
355create_ml_includes-allfiles() { 357create_ml_includes-allfiles() {
356 local basedirs=${@} 358 local basedirs=${@}
357 359
358 local files 360 local basedir
359 for basedir in ${basedirs}; do 361 for basedir in ${basedirs}; do
360 local file 362 local file
361 for file in $(find ${D}/${basedir} -type f); do 363 for file in $(find ${D}/${basedir} -type f); do
362 echo ${file/${D}\/${basedir}\//} 364 echo ${file/${D}\/${basedir}\//}
363 done 365 done
373 if [ "${dir}" = "${data/*:/}" ]; then 375 if [ "${dir}" = "${data/*:/}" ]; then
374 echo ${data/:*/} 376 echo ${data/:*/}
375 return 0 377 return 0
376 fi 378 fi
377 done 379 done
378 echo "Should be here -- create_ml_includes-sym_for_dir ${1} ${@}" 380 echo "Shouldn't be here -- create_ml_includes-sym_for_dir ${1} ${@}"
379 # exit because we'll likely be called from a subshell 381 # exit because we'll likely be called from a subshell
380 exit 1 382 exit 1
381} 383}

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

  ViewVC Help
Powered by ViewVC 1.1.20