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

Diff of /eclass/eutils.eclass

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

Revision 1.304 Revision 1.309
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 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.304 2008/09/20 18:45:26 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.309 2009/02/07 10:57:38 pva 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
77# Default options for patch 77# Default options for patch
78# Set -g0 to keep RCS, ClearCase, Perforce and SCCS happy. Bug #24571 78# Set -g0 to keep RCS, ClearCase, Perforce and SCCS happy. Bug #24571
79# Set --no-backup-if-mismatch so we don't leave '.orig' files behind. 79# Set --no-backup-if-mismatch so we don't leave '.orig' files behind.
80# Set -E to automatically remove empty files. 80# Set -E to automatically remove empty files.
81EPATCH_OPTS="-g0 -E --no-backup-if-mismatch" 81EPATCH_OPTS="-g0 -E --no-backup-if-mismatch"
82# List of patches not to apply. Not this is only file names, 82# List of patches not to apply. Note this is only file names,
83# and not the full path .. 83# and not the full path ..
84EPATCH_EXCLUDE="" 84EPATCH_EXCLUDE=""
85# Change the printed message for a single patch. 85# Change the printed message for a single patch.
86EPATCH_SINGLE_MSG="" 86EPATCH_SINGLE_MSG=""
87# Change the printed message for multiple patches. 87# Change the printed message for multiple patches.
105# bug they should be left as is to ensure an ebuild can rely on 105# bug they should be left as is to ensure an ebuild can rely on
106# them for. 106# them for.
107# 107#
108# Patches are applied in current directory. 108# Patches are applied in current directory.
109# 109#
110# Bulk Patches should preferibly have the form of: 110# Bulk Patches should preferably have the form of:
111# 111#
112# ??_${ARCH}_foo.${EPATCH_SUFFIX} 112# ??_${ARCH}_foo.${EPATCH_SUFFIX}
113# 113#
114# For example: 114# For example:
115# 115#
260 count=5 260 count=5
261 break 261 break
262 fi 262 fi
263 else 263 else
264 PATCH_TARGET="${x}" 264 PATCH_TARGET="${x}"
265 fi
266
267 # Check for absolute paths in patches. If sandbox is disabled,
268 # people could (accidently) patch files in the root filesystem.
269 # Or trigger other unpleasantries #237667. So disallow -p0 on
270 # such patches.
271 local abs_paths=$(egrep -n '^[-+]{3} /' "${PATCH_TARGET}" | awk '$2 != "/dev/null" { print }')
272 if [[ -n ${abs_paths} ]] ; then
273 count=1
274 echo "NOTE: skipping -p0 due to absolute paths in patch:" >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}
275 echo "${abs_paths}" >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/}
265 fi 276 fi
266 277
267 # Allow for prefix to differ ... im lazy, so shoot me :/ 278 # Allow for prefix to differ ... im lazy, so shoot me :/
268 while [ "${count}" -lt 5 ] 279 while [ "${count}" -lt 5 ]
269 do 280 do

Legend:
Removed from v.1.304  
changed lines
  Added in v.1.309

  ViewVC Help
Powered by ViewVC 1.1.20