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

Diff of /eclass/eutils.eclass

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

Revision 1.360 Revision 1.361
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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.360 2011/08/07 23:35:28 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.361 2011/08/08 02:01:40 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
439 done 439 done
440 440
441 [[ ${SINGLE_PATCH} == "no" ]] && einfo "Done with patching" 441 [[ ${SINGLE_PATCH} == "no" ]] && einfo "Done with patching"
442 : # everything worked 442 : # everything worked
443} 443}
444
445# @FUNCTION: epatch_user
446# @USAGE:
447# @DESCRIPTION:
448# Applies user-provided patches to the source tree. The patches are
449# taken from /etc/portage/patches/<CATEGORY>/<PF|P|PN>/, where the first
450# of these three directories to exist will be the one to use, ignoring
451# any more general directories which might exist as well.
452#
453# User patches are intended for quick testing of patches without ebuild
454# modifications, as well as for permanent customizations a user might
455# desire. Obviously, there can be no official support for arbitrarily
456# patched ebuilds. So whenever a build log in a bug report mentions that
457# user patches were applied, the user should be asked to reproduce the
458# problem without these.
459#
460# Not all ebuilds do call this function, so placing patches in the
461# stated directory might or might not work, depending on the package and
462# the eclasses it inherits and uses. It is safe to call the function
463# repeatedly, so it is always possible to add a call at the ebuild
464# level. The first call is the time when the patches will be
465# applied.
466#
467# Ideally, this function should be called after gentoo-specific patches
468# have been applied, so that their code can be modified as well, but
469# before calls to e.g. eautoreconf, as the user patches might affect
470# autotool input files as well.
444epatch_user() { 471epatch_user() {
445 [[ $# -ne 0 ]] && die "epatch_user takes no options" 472 [[ $# -ne 0 ]] && die "epatch_user takes no options"
473
474 # Allow multiple calls to this function; ignore all but the first
475 local applied="${T}/epach_user.applied"
476 [[ -e ${applied} ]] && return 2
446 477
447 # don't clobber any EPATCH vars that the parent might want 478 # don't clobber any EPATCH vars that the parent might want
448 local EPATCH_SOURCE check base=${PORTAGE_CONFIGROOT%/}/etc/portage/patches 479 local EPATCH_SOURCE check base=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
449 for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do 480 for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do
450 EPATCH_SOURCE=${base}/${CTARGET}/${check} 481 EPATCH_SOURCE=${base}/${CTARGET}/${check}
454 EPATCH_SOURCE=${EPATCH_SOURCE} \ 485 EPATCH_SOURCE=${EPATCH_SOURCE} \
455 EPATCH_SUFFIX="patch" \ 486 EPATCH_SUFFIX="patch" \
456 EPATCH_FORCE="yes" \ 487 EPATCH_FORCE="yes" \
457 EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \ 488 EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \
458 epatch 489 epatch
490 echo "${EPATCH_SOURCE}" > "${applied}"
459 return 0 491 return 0
460 fi 492 fi
461 done 493 done
494 echo "none" > "${applied}"
462 return 1 495 return 1
463} 496}
464 497
465# @FUNCTION: emktemp 498# @FUNCTION: emktemp
466# @USAGE: [temp dir] 499# @USAGE: [temp dir]

Legend:
Removed from v.1.360  
changed lines
  Added in v.1.361

  ViewVC Help
Powered by ViewVC 1.1.20