summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-09-20 18:58:57 +0000
committerMike Frysinger <vapier@gentoo.org>2008-09-20 18:58:57 +0000
commit36904781546c42bccb23feefcb5d9b9b69542e6e (patch)
tree4a22b48bae04a57e9c9ac35b95db016c9f90ed98 /eclass/eutils.eclass
parentstart whining about absolute paths in patch files (diff)
downloadgentoo-2-36904781546c42bccb23feefcb5d9b9b69542e6e.tar.gz
gentoo-2-36904781546c42bccb23feefcb5d9b9b69542e6e.tar.bz2
gentoo-2-36904781546c42bccb23feefcb5d9b9b69542e6e.zip
filter /dev/null from abs path check and include the offending line in the warning
Diffstat (limited to 'eclass/eutils.eclass')
-rw-r--r--eclass/eutils.eclass6
1 files changed, 4 insertions, 2 deletions
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 :/