epatch was changed to auto-skip the first path element when it is absolute (starts with a slash). the reason was to avoid issues with patches touching files outside of $PWD (which is bad if sandbox is disabled).
along those lines, we should start rejecting relative paths. we cant auto-
skip the leading elements since relative paths could appear anywhere.
rather than making it fatal right away, this patch adds some ewarns. after a
while, we can convert it to a die.
-mike
--- eutils.eclass 22 Nov 2010 00:31:03 -0000 1.352
+++ eutils.eclass 30 Dec 2010 23:52:41 -0000
@@ -360,6 +360,12 @@ epatch() {
count=1
printf "NOTE: skipping -p0 due to absolute paths in
patch:\n%s\n" "${abs_paths}" >> "${STDERR_TARGET}"
fi
+ # Similar reason, but with relative paths.
+ local rel_paths=$(egrep -n '^[-+]{3} [^\t]*[.][.]/'
"${PATCH_TARGET}")
+ if [[ -n ${rel_paths} ]] ; then
+ ewarn "Your patch has relative paths; in the future
this will fail:"
+ ewarn "${rel_paths}"
+ fi
# Dynamically detect the correct -p# ... i'm lazy, so shoot me
:/
while [[ ${count} -lt 5 ]] ; do
signature.asc
Description: This is a digitally signed message part.
