Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] epatch: reject patches with relative paths
Date: Fri, 31 Dec 2010 01:29:47
Message-Id: 201012302028.43244.vapier@gentoo.org
In Reply to: Re: [gentoo-dev] epatch: reject patches with relative paths by "Robin H. Johnson"
1 On Thursday, December 30, 2010 19:42:35 Robin H. Johnson wrote:
2 > On Thu, Dec 30, 2010 at 07:04:25PM -0500, Mike Frysinger wrote:
3 > > epatch was changed to auto-skip the first path element when it is
4 > > absolute (starts with a slash). the reason was to avoid issues with
5 > > patches touching files outside of $PWD (which is bad if sandbox is
6 > > disabled).
7 >
8 > +1 from me, but can we have a QA prefix on the ewarn output?
9
10 --- eutils.eclass 22 Nov 2010 00:31:03 -0000 1.352
11 +++ eutils.eclass 31 Dec 2010 01:28:37 -0000
12 @@ -360,6 +360,13 @@ epatch() {
13 count=1
14 printf "NOTE: skipping -p0 due to absolute paths in patch:\n%s\n" "${abs_paths}" >> "${STDERR_TARGET}"
15 fi
16 + # Similar reason, but with relative paths.
17 + local rel_paths=$(egrep -n '^[-+]{3} [^ ]*[.][.]/' "${PATCH_TARGET}")
18 + if [[ -n ${rel_paths} ]] ; then
19 + eqawarn "QA Notice: Your patch has relative paths."
20 + eqawarn " In the future this will cause a failure."
21 + eqawarn "${rel_paths}"
22 + fi
23
24 # Dynamically detect the correct -p# ... i'm lazy, so shoot me :/
25 while [[ ${count} -lt 5 ]] ; do
26 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] epatch: reject patches with relative paths Markos Chandras <hwoarang@g.o>
Re: [gentoo-dev] epatch: reject patches with relative paths "Jory A. Pratt" <anarchy@g.o>