| 1 | # Copyright 1999-2005 Gentoo Foundation |
1 | # Copyright 1999-2005 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/libtool.eclass,v 1.61 2005/10/09 13:01:41 flameeyes Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.62 2005/12/07 22:50:05 azarah Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Martin Schlemmer <azarah@gentoo.org> |
5 | # Author: Martin Schlemmer <azarah@gentoo.org> |
| 6 | # |
6 | # |
| 7 | # This eclass patches ltmain.sh distributed with libtoolized packages with the |
7 | # This eclass patches ltmain.sh distributed with libtoolized packages with the |
| 8 | # relink and portage patch among others |
8 | # relink and portage patch among others |
| … | |
… | |
| 45 | local ret=0 |
45 | local ret=0 |
| 46 | local file=$1 |
46 | local file=$1 |
| 47 | local patch=$2 |
47 | local patch=$2 |
| 48 | |
48 | |
| 49 | # We only support patchlevel of 0 - why worry if its static patches? |
49 | # We only support patchlevel of 0 - why worry if its static patches? |
| 50 | if patch -p0 --dry-run "${file}" < "${patch}" &> "${T}/elibtool.log" ; then |
50 | if patch -p0 --dry-run "${file}" "${patch}" &> "${T}/elibtool.log" ; then |
| 51 | einfo " Applying $(basename "$(dirname "${patch}")")-${patch##*/}.patch ..." |
51 | einfo " Applying $(basename "$(dirname "${patch}")")-${patch##*/}.patch ..." |
| 52 | patch -p0 "${file}" < "${patch}" &> "${T}/elibtool.log" |
52 | patch -p0 -g0 --no-backup-if-mismatch "${file}" "${patch}" \ |
|
|
53 | &> "${T}/elibtool.log" |
| 53 | ret=$? |
54 | ret=$? |
| 54 | export ELT_APPLIED_PATCHES="${ELT_APPLIED_PATCHES} ${patch##*/}" |
55 | export ELT_APPLIED_PATCHES="${ELT_APPLIED_PATCHES} ${patch##*/}" |
| 55 | else |
56 | else |
| 56 | ret=1 |
57 | ret=1 |
| 57 | fi |
58 | fi |
| … | |
… | |
| 102 | eerror "Could not get VERSION for ${file##*/}!" |
103 | eerror "Could not get VERSION for ${file##*/}!" |
| 103 | die "Could not get VERSION for ${file##*/}!" |
104 | die "Could not get VERSION for ${file##*/}!" |
| 104 | fi |
105 | fi |
| 105 | |
106 | |
| 106 | # Go through the patches in reverse order (large to small) |
107 | # Go through the patches in reverse order (large to small) |
| 107 | for x in $(ls -d "${patch_dir}"/* 2> /dev/null | sort -r) ; do |
108 | for x in $(ls -d "${patch_dir}"/* 2> /dev/null | grep -v 'CVS' | sort -r) ; do |
| 108 | if [[ -n ${x} && -f ${x} ]] ; then |
109 | if [[ -n ${x} && -f ${x} ]] ; then |
| 109 | local ltver=$(VER_to_int "${version}") |
110 | local ltver=$(VER_to_int "${version}") |
| 110 | local ptver=$(VER_to_int "${x##*/}") |
111 | local ptver=$(VER_to_int "${x##*/}") |
| 111 | |
112 | |
| 112 | # If libtool version smaller than patch version, skip patch. |
113 | # If libtool version smaller than patch version, skip patch. |