| 1 | # Copyright 1999-2002 Gentoo Technologies, Inc. |
1 | # Copyright 1999-2002 Gentoo Technologies, Inc. |
| 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 | # Author: Martin Schlemmer <azarah@gentoo.org> |
3 | # Author: Martin Schlemmer <azarah@gentoo.org> |
| 4 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.8 2002/12/01 12:34:23 azarah Exp $ |
4 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.9 2002/12/01 15:48:27 azarah Exp $ |
| 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! |
| 9 | |
9 | |
| … | |
… | |
| 90 | # Default options for patch |
90 | # Default options for patch |
| 91 | EPATCH_OPTS="" |
91 | EPATCH_OPTS="" |
| 92 | # List of patches not to apply. Not this is only file names, |
92 | # List of patches not to apply. Not this is only file names, |
| 93 | # and not the full path .. |
93 | # and not the full path .. |
| 94 | EPATCH_EXCLUDE="" |
94 | EPATCH_EXCLUDE="" |
|
|
95 | # Change the printed message for a single patch. |
|
|
96 | EPATCH_SINGLE_MSG="" |
| 95 | |
97 | |
| 96 | # This function is for bulk patching, or in theory for just one |
98 | # This function is for bulk patching, or in theory for just one |
| 97 | # or two patches. |
99 | # or two patches. |
| 98 | # |
100 | # |
| 99 | # It should work with .bz2, .gz, .zip and plain text patches. |
101 | # It should work with .bz2, .gz, .zip and plain text patches. |
| … | |
… | |
| 190 | # New ARCH dependant patch naming scheme... |
192 | # New ARCH dependant patch naming scheme... |
| 191 | # |
193 | # |
| 192 | # ???_arch_foo.patch |
194 | # ???_arch_foo.patch |
| 193 | # |
195 | # |
| 194 | if [ -f ${x} ] && \ |
196 | if [ -f ${x} ] && \ |
| 195 | [ -n "$1" -o "${x/_all_}" != "${x}" -o "`eval echo \$\{x/_${ARCH}_\}`" != "${x}" ] |
197 | [ "${SINGLE_PATCH}" = "yes" -o "${x/_all_}" != "${x}" -o "`eval echo \$\{x/_${ARCH}_\}`" != "${x}" ] |
| 196 | then |
198 | then |
| 197 | local count=0 |
199 | local count=0 |
| 198 | local popts="${EPATCH_OPTS}" |
200 | local popts="${EPATCH_OPTS}" |
| 199 | |
201 | |
| 200 | if [ -n "${EPATCH_EXCLUDE}" ] |
202 | if [ -n "${EPATCH_EXCLUDE}" ] |
| 201 | then |
203 | then |
| 202 | if [ "${EPATCH_EXCLUDE/${x##*/}}" != "${EPATCH_EXCLUDE}" ] |
204 | if [ "`eval echo \$\{EPATCH_EXCLUDE/${x##*/}\}`" != "${EPATCH_EXCLUDE}" ] |
| 203 | then |
205 | then |
| 204 | continue |
206 | continue |
| 205 | fi |
207 | fi |
| 206 | fi |
208 | fi |
| 207 | |
209 | |
| 208 | if [ "${SINGLE_PATCH}" = "yes" ] |
210 | if [ "${SINGLE_PATCH}" = "yes" ] |
| 209 | then |
211 | then |
|
|
212 | if [ -n "${EPATCH_SINGLE_MSG}" ] |
|
|
213 | then |
|
|
214 | einfo "${EPATCH_SINGLE_MSG}" |
|
|
215 | else |
| 210 | einfo "Applying ${x##*/}..." |
216 | einfo "Applying ${x##*/}..." |
|
|
217 | fi |
| 211 | else |
218 | else |
| 212 | einfo " ${x##*/}..." |
219 | einfo " ${x##*/}..." |
| 213 | fi |
220 | fi |
| 214 | |
221 | |
| 215 | echo "***** ${x##*/} *****" > ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} |
222 | echo "***** ${x##*/} *****" > ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} |