| 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.5 2002/11/11 22:36:22 azarah Exp $ |
4 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.6 2002/11/12 18:25:37 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 themselfs. |
6 | # have to implement themselfs. |
| 7 | # |
7 | # |
| 8 | # NB: If you add anything, please comment it! |
8 | # NB: If you add anything, please comment it! |
| 9 | |
9 | |
| … | |
… | |
| 87 | EPATCH_SOURCE="${WORKDIR}/patch" |
87 | EPATCH_SOURCE="${WORKDIR}/patch" |
| 88 | # Default extension for patches |
88 | # Default extension for patches |
| 89 | EPATCH_SUFFIX="patch.bz2" |
89 | EPATCH_SUFFIX="patch.bz2" |
| 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, |
|
|
93 | # and not the full path .. |
|
|
94 | EPATCH_EXCLUDE="" |
| 92 | |
95 | |
| 93 | # This function is for bulk patching, or in theory for just one |
96 | # This function is for bulk patching, or in theory for just one |
| 94 | # or two patches. |
97 | # or two patches. |
| 95 | # |
98 | # |
| 96 | # It should work with .bz2, .gz, .zip and plain text patches. |
99 | # It should work with .bz2, .gz, .zip and plain text patches. |
| … | |
… | |
| 151 | |
154 | |
| 152 | case ${EPATCH_SUFFIX##*\.} in |
155 | case ${EPATCH_SUFFIX##*\.} in |
| 153 | bz2) |
156 | bz2) |
| 154 | PIPE_CMD="bzip2 -dc" |
157 | PIPE_CMD="bzip2 -dc" |
| 155 | ;; |
158 | ;; |
| 156 | gz) |
159 | gz|Z|z) |
| 157 | PIPE_CMD="gzip -dc" |
160 | PIPE_CMD="gzip -dc" |
| 158 | ;; |
161 | ;; |
| 159 | zip) |
162 | ZIP|zip) |
| 160 | PIPE_CMD="unzip -p" |
163 | PIPE_CMD="unzip -p" |
| 161 | ;; |
164 | ;; |
| 162 | *) |
165 | *) |
| 163 | PIPE_CMD="cat" |
166 | PIPE_CMD="cat" |
| 164 | ;; |
167 | ;; |
| … | |
… | |
| 177 | if [ -f ${x} ] && \ |
180 | if [ -f ${x} ] && \ |
| 178 | [ -n "$1" -o "${x/_all_}" != "${x}" -o "`eval echo \$\{x/_${ARCH}_\}`" != "${x}" ] |
181 | [ -n "$1" -o "${x/_all_}" != "${x}" -o "`eval echo \$\{x/_${ARCH}_\}`" != "${x}" ] |
| 179 | then |
182 | then |
| 180 | local count=0 |
183 | local count=0 |
| 181 | local popts="${EPATCH_OPTS}" |
184 | local popts="${EPATCH_OPTS}" |
|
|
185 | |
|
|
186 | if [ -n "${EPATCH_EXCLUDE}" ] |
|
|
187 | then |
|
|
188 | if [ "${EPATCH_EXCLUDE/${x##*/}}" != "${EPATCH_EXCLUDE}" ] |
|
|
189 | then |
|
|
190 | continue |
|
|
191 | fi |
|
|
192 | fi |
| 182 | |
193 | |
| 183 | if [ "${SINGLE_PATCH}" = "yes" ] |
194 | if [ "${SINGLE_PATCH}" = "yes" ] |
| 184 | then |
195 | then |
| 185 | einfo "Applying ${x##*/}..." |
196 | einfo "Applying ${x##*/}..." |
| 186 | else |
197 | else |