/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.149 Revision 1.150
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/eutils.eclass,v 1.149 2005/02/04 21:24:53 chriswhite Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.150 2005/02/08 10:59:46 eradicator Exp $
4# 4#
5# Author: Martin Schlemmer <azarah@gentoo.org> 5# Author: Martin Schlemmer <azarah@gentoo.org>
6# 6#
7# This eclass is for general purpose functions that most ebuilds 7# This eclass is for general purpose functions that most ebuilds
8# have to implement themselves. 8# have to implement themselves.
292 ([ "${SINGLE_PATCH}" = "yes" -o "${x/_all_}" != "${x}" -o "`eval echo \$\{x/_${ARCH}_\}`" != "${x}" ] || \ 292 ([ "${SINGLE_PATCH}" = "yes" -o "${x/_all_}" != "${x}" -o "`eval echo \$\{x/_${ARCH}_\}`" != "${x}" ] || \
293 [ "${EPATCH_FORCE}" = "yes" ]) 293 [ "${EPATCH_FORCE}" = "yes" ])
294 then 294 then
295 local count=0 295 local count=0
296 local popts="${EPATCH_OPTS}" 296 local popts="${EPATCH_OPTS}"
297 local patchname=${x##*/}
297 298
298 if [ -n "${EPATCH_EXCLUDE}" ] 299 if [ -n "${EPATCH_EXCLUDE}" ]
299 then 300 then
300 if [ "`eval echo \$\{EPATCH_EXCLUDE/${x##*/}\}`" != "${EPATCH_EXCLUDE}" ] 301 if [ "${EPATCH_EXCLUDE/${patchname}}" != "${EPATCH_EXCLUDE}" ]
301 then 302 then
302 continue 303 continue
303 fi 304 fi
304 fi 305 fi
305 306
307 then 308 then
308 if [ -n "${EPATCH_SINGLE_MSG}" ] 309 if [ -n "${EPATCH_SINGLE_MSG}" ]
309 then 310 then
310 einfo "${EPATCH_SINGLE_MSG}" 311 einfo "${EPATCH_SINGLE_MSG}"
311 else 312 else
312 einfo "Applying ${x##*/} ..." 313 einfo "Applying ${patchname} ..."
313 fi 314 fi
314 else 315 else
315 einfo " ${x##*/} ..." 316 einfo " ${patchname} ..."
316 fi 317 fi
317 318
318 echo "***** ${x##*/} *****" > ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 319 echo "***** ${patchname} *****" > ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}
319 echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 320 echo >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}
320 321
321 # Allow for prefix to differ ... im lazy, so shoot me :/ 322 # Allow for prefix to differ ... im lazy, so shoot me :/
322 while [ "${count}" -lt 5 ] 323 while [ "${count}" -lt 5 ]
323 do 324 do
324 # Generate some useful debug info ... 325 # Generate some useful debug info ...
325 draw_line "***** ${x##*/} *****" >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 326 draw_line "***** ${patchname} *****" >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}
326 echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 327 echo >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}
327 328
328 if [ "${PATCH_SUFFIX}" != "patch" ] 329 if [ "${PATCH_SUFFIX}" != "patch" ]
329 then 330 then
330 echo -n "PIPE_COMMAND: " >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 331 echo -n "PIPE_COMMAND: " >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}
331 echo "${PIPE_CMD} ${x} > ${PATCH_TARGET}" >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 332 echo "${PIPE_CMD} ${x} > ${PATCH_TARGET}" >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}
332 else 333 else
333 PATCH_TARGET="${x}" 334 PATCH_TARGET="${x}"
334 fi 335 fi
335 336
336 echo -n "PATCH COMMAND: " >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 337 echo -n "PATCH COMMAND: " >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}
337 echo "patch -p${count} ${popts} < ${PATCH_TARGET}" >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 338 echo "patch -p${count} ${popts} < ${PATCH_TARGET}" >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}
338 339
339 echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 340 echo >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}
340 draw_line "***** ${x##*/} *****" >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 341 draw_line "***** ${patchname} *****" >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}
341 342
342 if [ "${PATCH_SUFFIX}" != "patch" ] 343 if [ "${PATCH_SUFFIX}" != "patch" ]
343 then 344 then
344 if ! (${PIPE_CMD} ${x} > ${PATCH_TARGET}) >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 2>&1 345 if ! (${PIPE_CMD} ${x} > ${PATCH_TARGET}) >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/} 2>&1
345 then 346 then
346 echo 347 echo
347 eerror "Could not extract patch!" 348 eerror "Could not extract patch!"
348 #die "Could not extract patch!" 349 #die "Could not extract patch!"
349 count=5 350 count=5
350 break 351 break
351 fi 352 fi
352 fi 353 fi
353 354
354 if (cat ${PATCH_TARGET} | patch -p${count} ${popts} --dry-run -f) >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 2>&1 355 if (cat ${PATCH_TARGET} | patch -p${count} ${popts} --dry-run -f) >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/} 2>&1
355 then 356 then
356 draw_line "***** ${x##*/} *****" > ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 357 draw_line "***** ${patchname} *****" > ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}.real
357 echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 358 echo >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}.real
358 echo "ACTUALLY APPLYING ${x##*/} ..." >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 359 echo "ACTUALLY APPLYING ${patchname} ..." >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}.real
359 echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 360 echo >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}.real
360 draw_line "***** ${x##*/} *****" >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 361 draw_line "***** ${patchname} *****" >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}.real
361 362
362 cat ${PATCH_TARGET} | patch -p${count} ${popts} >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 2>&1 363 cat ${PATCH_TARGET} | patch -p${count} ${popts} >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}.real 2>&1
363 364
364 if [ "$?" -ne 0 ] 365 if [ "$?" -ne 0 ]
365 then 366 then
366 cat ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 367 cat ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}.real >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}
367 echo 368 echo
368 eerror "A dry-run of patch command succeeded, but actually" 369 eerror "A dry-run of patch command succeeded, but actually"
369 eerror "applying the patch failed!" 370 eerror "applying the patch failed!"
370 #die "Real world sux compared to the dreamworld!" 371 #die "Real world sux compared to the dreamworld!"
371 count=5 372 count=5
372 fi 373 fi
373 374
374 rm -f ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 375 rm -f ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}.real
375 376
376 break 377 break
377 fi 378 fi
378 379
379 count=$((count + 1)) 380 count=$((count + 1))
385 fi 386 fi
386 387
387 if [ "${count}" -eq 5 ] 388 if [ "${count}" -eq 5 ]
388 then 389 then
389 echo 390 echo
390 eerror "Failed Patch: ${x##*/}!" 391 eerror "Failed Patch: ${patchname}!"
391 eerror 392 eerror
392 eerror "Include in your bugreport the contents of:" 393 eerror "Include in your bugreport the contents of:"
393 eerror 394 eerror
394 eerror " ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}" 395 eerror " ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}"
395 echo 396 echo
396 die "Failed Patch: ${x##*/}!" 397 die "Failed Patch: ${patchname}!"
397 fi 398 fi
398 399
399 rm -f ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 400 rm -f ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}
400 401
401 eend 0 402 eend 0
402 fi 403 fi
403 done 404 done
404 if [ "${SINGLE_PATCH}" = "no" ] 405 if [ "${SINGLE_PATCH}" = "no" ]

Legend:
Removed from v.1.149  
changed lines
  Added in v.1.150

  ViewVC Help
Powered by ViewVC 1.1.20