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

Diff of /eclass/eutils.eclass

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

Revision 1.382 Revision 1.383
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 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.382 2012/02/14 16:08:54 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.383 2012/02/16 00:27:17 vapier Exp $
4 4
5# @ECLASS: eutils.eclass 5# @ECLASS: eutils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @BLURB: many extra (but common) functions that are used in ebuilds 8# @BLURB: many extra (but common) functions that are used in ebuilds
440 eqawarn " In the future this will cause a failure." 440 eqawarn " In the future this will cause a failure."
441 eqawarn "${rel_paths}" 441 eqawarn "${rel_paths}"
442 fi 442 fi
443 443
444 # Dynamically detect the correct -p# ... i'm lazy, so shoot me :/ 444 # Dynamically detect the correct -p# ... i'm lazy, so shoot me :/
445 local patch_cmd
445 while [[ ${count} -lt 5 ]] ; do 446 while [[ ${count} -lt 5 ]] ; do
447 patch_cmd="patch -p${count} ${EPATCH_OPTS}"
448
446 # Generate some useful debug info ... 449 # Generate some useful debug info ...
447 ( 450 (
448 _epatch_draw_line "***** ${patchname} *****" 451 _epatch_draw_line "***** ${patchname} *****"
449 echo 452 echo
450 echo "PATCH COMMAND: patch -p${count} ${EPATCH_OPTS} < '${PATCH_TARGET}'" 453 echo "PATCH COMMAND: ${patch_cmd} < '${PATCH_TARGET}'"
451 echo 454 echo
452 _epatch_draw_line "***** ${patchname} *****" 455 _epatch_draw_line "***** ${patchname} *****"
453 patch -p${count} ${EPATCH_OPTS} --dry-run -f < "${PATCH_TARGET}" 2>&1 456 ${patch_cmd} --dry-run -f < "${PATCH_TARGET}" 2>&1
454 ret=$? 457 ret=$?
455 echo 458 echo
456 echo "patch program exited with status ${ret}" 459 echo "patch program exited with status ${ret}"
457 exit ${ret} 460 exit ${ret}
458 ) >> "${STDERR_TARGET}" 461 ) >> "${STDERR_TARGET}"
462 _epatch_draw_line "***** ${patchname} *****" 465 _epatch_draw_line "***** ${patchname} *****"
463 echo 466 echo
464 echo "ACTUALLY APPLYING ${patchname} ..." 467 echo "ACTUALLY APPLYING ${patchname} ..."
465 echo 468 echo
466 _epatch_draw_line "***** ${patchname} *****" 469 _epatch_draw_line "***** ${patchname} *****"
467 patch -p${count} ${EPATCH_OPTS} < "${PATCH_TARGET}" 2>&1 470 ${patch_cmd} < "${PATCH_TARGET}" 2>&1
468 ret=$? 471 ret=$?
469 echo 472 echo
470 echo "patch program exited with status ${ret}" 473 echo "patch program exited with status ${ret}"
471 exit ${ret} 474 exit ${ret}
472 ) >> "${STDERR_TARGET}" 475 ) >> "${STDERR_TARGET}"
499 eerror " ${STDERR_TARGET}" 502 eerror " ${STDERR_TARGET}"
500 echo 503 echo
501 die "Failed Patch: ${patchname}!" 504 die "Failed Patch: ${patchname}!"
502 fi 505 fi
503 506
504 # if everything worked, delete the patch log 507 # if everything worked, delete the full debug patch log
505 rm -f "${STDERR_TARGET}" 508 rm -f "${STDERR_TARGET}"
509
510 # then log away the exact stuff for people to review later
511 cat <<-EOF >> "${T}/epatch.log"
512 PATCH: ${x}
513 CMD: ${patch_cmd}
514 PWD: ${PWD}
515
516 EOF
506 eend 0 517 eend 0
507 done 518 done
508 519
509 [[ ${SINGLE_PATCH} == "no" ]] && einfo "Done with patching" 520 [[ ${SINGLE_PATCH} == "no" ]] && einfo "Done with patching"
510 : # everything worked 521 : # everything worked
538# autotool input files as well. 549# autotool input files as well.
539epatch_user() { 550epatch_user() {
540 [[ $# -ne 0 ]] && die "epatch_user takes no options" 551 [[ $# -ne 0 ]] && die "epatch_user takes no options"
541 552
542 # Allow multiple calls to this function; ignore all but the first 553 # Allow multiple calls to this function; ignore all but the first
543 local applied="${T}/epatch_user.applied" 554 local applied="${T}/epatch_user.log"
544 [[ -e ${applied} ]] && return 2 555 [[ -e ${applied} ]] && return 2
545 556
546 # don't clobber any EPATCH vars that the parent might want 557 # don't clobber any EPATCH vars that the parent might want
547 local EPATCH_SOURCE check base=${PORTAGE_CONFIGROOT%/}/etc/portage/patches 558 local EPATCH_SOURCE check base=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
548 for check in ${CATEGORY}/{${P}-${PR},${P},${PN}}; do 559 for check in ${CATEGORY}/{${P}-${PR},${P},${PN}}; do

Legend:
Removed from v.1.382  
changed lines
  Added in v.1.383

  ViewVC Help
Powered by ViewVC 1.1.20