Gentoo Archives: gentoo-dev

From: "Jory A. Pratt" <anarchy@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] epatch: reject patches with relative paths
Date: Fri, 31 Dec 2010 02:06:16
Message-Id: 4D1D3A61.6050209@gentoo.org
In Reply to: Re: [gentoo-dev] epatch: reject patches with relative paths by Mike Frysinger
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 On 12/30/2010 07:28 PM, Mike Frysinger wrote:
5 > On Thursday, December 30, 2010 19:42:35 Robin H. Johnson wrote:
6 >> On Thu, Dec 30, 2010 at 07:04:25PM -0500, Mike Frysinger wrote:
7 >>> epatch was changed to auto-skip the first path element when it is
8 >>> absolute (starts with a slash). the reason was to avoid issues with
9 >>> patches touching files outside of $PWD (which is bad if sandbox is
10 >>> disabled).
11 >>
12 >> +1 from me, but can we have a QA prefix on the ewarn output?
13 >
14 > --- eutils.eclass 22 Nov 2010 00:31:03 -0000 1.352
15 > +++ eutils.eclass 31 Dec 2010 01:28:37 -0000
16 > @@ -360,6 +360,13 @@ epatch() {
17 > count=1
18 > printf "NOTE: skipping -p0 due to absolute paths in patch:\n%s\n" "${abs_paths}" >> "${STDERR_TARGET}"
19 > fi
20 > + # Similar reason, but with relative paths.
21 > + local rel_paths=$(egrep -n '^[-+]{3} [^ ]*[.][.]/' "${PATCH_TARGET}")
22 > + if [[ -n ${rel_paths} ]] ; then
23 > + eqawarn "QA Notice: Your patch has relative paths."
24 > + eqawarn " In the future this will cause a failure."
25 > + eqawarn "${rel_paths}"
26 > + fi
27 >
28 > # Dynamically detect the correct -p# ... i'm lazy, so shoot me :/
29 > while [[ ${count} -lt 5 ]] ; do
30 > -mike
31 +1 from me!!!
32
33 - --
34 ======================================================
35 Jory A. Pratt anarchy -at- gentoo.org
36 Gentoo Mozilla Lead
37 GPG: 2C1D 6AF9 F35D 5122 0E8F 9123 C270 3B43 5674 6127
38 ======================================================
39
40 -----BEGIN PGP SIGNATURE-----
41 Version: GnuPG v2.0.16 (GNU/Linux)
42 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
43
44 iEYEARECAAYFAk0dOmEACgkQwnA7Q1Z0YSfEHwCgrI5PjbcIPBsCh2yzcTPa1gxf
45 +1AAn2w97jB4wYKo/k69jS6wj5wPfcPW
46 =tJ2w
47 -----END PGP SIGNATURE-----