From 14b62cce34f7e2feedfc04d4cb79b6d2e20e8681 Mon Sep 17 00:00:00 2001 From: Martin Schlemmer Date: Sun, 27 Feb 2005 20:29:04 +0000 Subject: Try to match patches more according to libtool version, bug #83486 --- eclass/libtool.eclass | 57 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 15 deletions(-) (limited to 'eclass/libtool.eclass') diff --git a/eclass/libtool.eclass b/eclass/libtool.eclass index aaaa6375fe2a..81488d72ec2c 100644 --- a/eclass/libtool.eclass +++ b/eclass/libtool.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/libtool.eclass,v 1.42 2005/01/31 03:02:13 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.43 2005/02/27 20:29:04 azarah Exp $ # # Author: Martin Schlemmer # @@ -68,6 +68,7 @@ ELT_walk_patches() { local y= local ret=1 local patch_dir= + local version=$(eval $(grep -e '^[[:space:]]*VERSION=' $1); echo "${VERSION}") if [[ -n $2 ]] ; then if [[ -d ${ELT_PATCH_DIR}/$2 ]] ; then @@ -76,24 +77,50 @@ ELT_walk_patches() { return ${ret} fi - for x in $(ls -d "${patch_dir}"/* 2> /dev/null) ; do - if [[ -n ${x} && -f ${x} ]] ; then - # For --remove-internal-dep ... - if [[ -n $3 ]] ; then - # For replace @REM_INT_DEP@ with what was passed - # to --remove-internal-dep - sed -e "s|@REM_INT_DEP@|$3|g" ${x} > \ - ${T}/$$.rem_int_deps.patch + # First check a version specific patch, if not check major.minor* + for y in ${version} $(echo "${version}" | cut -d. -f1,2) ; do + [[ -z ${y} ]] && continue + for x in $(ls -d "${patch_dir}/${y}"* 2> /dev/null) ; do + if [[ -n ${x} && -f ${x} ]] ; then + # For --remove-internal-dep ... + if [[ -n $3 ]] ; then + # For replace @REM_INT_DEP@ with what was passed + # to --remove-internal-dep + sed -e "s|@REM_INT_DEP@|$3|g" ${x} > \ + ${T}/$$.rem_int_deps.patch + + x="${T}/$$.rem_int_deps.patch" + fi - x="${T}/$$.rem_int_deps.patch" + if ELT_try_and_apply_patch "$1" "${x}" ; then + ret=0 + break + fi fi + done + done - if ELT_try_and_apply_patch "$1" "${x}" ; then - ret=0 - break + # If still nothing, try the rest. + if [[ ${ret} -eq 1 ]]; then + for x in $(ls -d "${patch_dir}"/* 2> /dev/null) ; do + if [[ -n ${x} && -f ${x} ]] ; then + # For --remove-internal-dep ... + if [[ -n $3 ]] ; then + # For replace @REM_INT_DEP@ with what was passed + # to --remove-internal-dep + sed -e "s|@REM_INT_DEP@|$3|g" ${x} > \ + ${T}/$$.rem_int_deps.patch + + x="${T}/$$.rem_int_deps.patch" + fi + + if ELT_try_and_apply_patch "$1" "${x}" ; then + ret=0 + break + fi fi - fi - done + done + fi fi return ${ret} -- cgit v1.2.3-65-gdbad