Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: "Chí-Thanh Christopher Nguyễn" <chithanh@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] versionator.eclass: Add tests for parameter counts
Date: Sun, 24 Jul 2016 07:49:34
Message-Id: 20160724094903.6135a0be.mgorny@gentoo.org
In Reply to: Re: [gentoo-dev] [PATCH] versionator.eclass: Add tests for parameter counts by "Chí-Thanh Christopher Nguyễn"
1 On Sun, 24 Jul 2016 00:17:21 +0200
2 Chí-Thanh Christopher Nguyễn <chithanh@g.o> wrote:
3
4 > Michał Górny schrieb:
5 > > Ensure that proper number of parameters is passed to each versionator
6 > > function; die otherwise. This prevents the functions from proceeding
7 > > with undefined behavior when mis-called.
8 >
9 > You are making what versionator.eclass accepts stricter. That it used to work
10 > when passed multiple versions may be unintentional, but I think you need to
11 > introduce a new eclass or new function names in this case.
12
13 So, to summarize we shouldn't fix existing code because people did
14 assume accepting invalid parameters was fine.
15
16 What we should do instead is create an almost identical copy of it, ask
17 people to switch to new code with parameter checks. But... why?
18
19 If people already pass valid parameters, then new and old code would be
20 functionally identical. If they do not, then they can fix parameters
21 and stay with the old code. But they shouldn't have been doing that in
22 the first place...
23
24 So in the end, we create another copy of the functions that's used
25 inconsistently with the old copy, and only when people feel like
26 switching. Then ebuilds will fail just the same because people wouldn't
27 care to *ensure* they pass valid parameters while switching, as long as
28 they won't trigger it on their limited test case...
29
30 --
31 Best regards,
32 Michał Górny
33 <http://dev.gentoo.org/~mgorny/>

Replies

Subject Author
Re: [gentoo-dev] [PATCH] versionator.eclass: Add tests for parameter counts "Chí-Thanh Christopher Nguyễn" <chithanh@g.o>