From 36904781546c42bccb23feefcb5d9b9b69542e6e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 20 Sep 2008 18:58:57 +0000 Subject: filter /dev/null from abs path check and include the offending line in the warning --- eclass/eutils.eclass | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'eclass') diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index cbbf7e60eba8..449d13d72410 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.305 2008/09/20 18:55:07 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.306 2008/09/20 18:58:57 vapier Exp $ # @ECLASS: eutils.eclass # @MAINTAINER: @@ -267,8 +267,10 @@ epatch() { # Check for absolute paths in patches. If sandbox is disabled, # people could (accidently) patch files in the root filesystem. # Or trigger other unpleasantries #237667. - if egrep -q '^[-+]{3} /' "${PATCH_TARGET}" ; then + local abs_paths=$(egrep -n '^[-+]{3} /' "${PATCH_TARGET}" | awk '$2 != "/dev/null" { print }') + if [[ -n ${abs_paths} ]] ; then ewarn "Absolute paths found in ${patchname}! Please remove them!" + ewarn "${abs_paths}" fi # Allow for prefix to differ ... im lazy, so shoot me :/ -- cgit v1.2.3-65-gdbad