Gentoo Archives: gentoo-dev

From: Alec Warner <antarus@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: Re: [gentoo-commits] gentoo-x86 commit in app-admin/chrpath: ChangeLog chrpath-0.13-r2.ebuild
Date: Wed, 12 Oct 2011 19:45:53
Message-Id: CAAr7Pr_EzruzdJ=zmeLEpoGor=Je+8wbacoLOer846_neUXvUQ@mail.gmail.com
In Reply to: Re: [gentoo-dev] Re: Re: [gentoo-commits] gentoo-x86 commit in app-admin/chrpath: ChangeLog chrpath-0.13-r2.ebuild by Mike Frysinger
1 On Wed, Oct 12, 2011 at 12:33 PM, Mike Frysinger <vapier@g.o> wrote:
2 > On Wednesday 12 October 2011 15:19:25 Samuli Suominen wrote:
3 >> On 10/12/2011 06:30 AM, Steven J Long wrote:
4 >> > Michał Górny wrote:
5 >> >> I don't think that passing multiple files to epatch actually improves
6 >> >> readability. Simple example:
7 >> >>
8 >> >> # bug #123456, foo, bar
9 >> >> epatch "${FILESDIR}"/${P}-foo.patch
10 >> >> # bug #234567, baz bazinga blah blah
11 >> >> epatch "${FILESDIR}"/${P}-baz.patch
12 >> >>
13 >> >> With multiple arguments, you can't put comments in the middle.
14 >> >
15 >> > ++ It's also a lot easier to remove the single patches when they're no
16 >> > longer needed.
17 >>
18 >> Removing an 'epatch foo' line is easier than 'foo \' ?  You are kidding,
19 >> right?
20 >>
21 >> > In the context of configuring, building and installing a
22 >> > package, the extra overhead is miniscule, whereas the above is *much*
23 >> > easier to maintain.
24 >>
25 >> Based on what argument?
26 >>
27 >> Having the comments inside the patch allows everyone, including
28 >> _upstreams_ straight up see what's it for and link to the bug it's
29 >> coming from. Where as keeping them in ebuilds makes it Gentoo specific,
30 >> which is not what we are about.
31 >
32 > i personally prefer:
33 >        epatch "${FILESDIR}"/${P}-foo.patch #12345
34 >        epatch "${FILESDIR}"/${P}-bar.patch #19512 #91991
35 >        epatch "${FILESDIR}"/${P}-fatcow.patch #19291
36 > because i personally like to have just the bug number there
37 >
38 > i know other people prefer to pass these all on one line:
39 >        epatch \
40 >                "${FILESDIR}"/${P}-foo.patch \
41 >                "${FILESDIR}"/${P}-bar.patch \
42 >                "${FILESDIR}"/${P}-fatcow.patch
43
44 The problem with the latter is the same problem I have w/python lists
45 and commas.
46
47 If I want to add a patch to the list I might forget to to add the \
48
49 epatch \
50 "${FILESDIR}"/${P}-foo.patch \
51 "${FILESDIR}"/${P}-last.patch # <-- Oops I forgot to add a \ here
52 "${FILESDIR}"/${P}-my-new.patch
53
54 Or I delete the last patch and forget to remove the \
55
56 epatch \
57 "${FILESDIR}"/${P}-foo.patch \
58 "${FILESDIR}"/${P}-bar.patch \ # <-- oops again!
59
60 >
61 > there is no standard here (i think they're more or less equally common) and
62 > maintainers are free to pick what they like best.  arguing about the merits
63 > between the two above styles is a waste of everyone's time.  go fix some bugs
64 > instead you lazy wankers :P.
65
66 I enjoy wasting time :)
67
68 >
69 > the one thing Samuli is correct about though and largely has nothing to do
70 > with style is that the patch itself needs to have all the relevant
71 > information.  doing the following is wrong:
72 >        # here i explain what the patch is for #12351
73 >        epatch "${FILESDIR}"/${P}-bar.patch
74 >        (and the bar patch contains only the diff)
75 >
76 > rather than rehash why you're wrong if you do the above, please read:
77 >        http://dev.gentoo.org/~vapier/clean-patches
78 > -mike
79 >

Replies