Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] [PATCH eutils] Support recursive operation in edos2unix.
Date: Sat, 13 Apr 2013 15:52:42
Message-Id: CAJ0EP43oQ3+f2naO42e-sNxYJCfPb-kX362HjZZRtz_eZWHgNw@mail.gmail.com
In Reply to: [gentoo-dev] [PATCH eutils] Support recursive operation in edos2unix. by "Michał Górny"
1 On Sat, Apr 13, 2013 at 10:44 AM, Michał Górny <mgorny@g.o> wrote:
2 > The edos2unix is quite useful when handling DOS-sourced packages.
3 > But since it's a bash function, you can't reasonably use it from within
4 > find invocation. And often you hit packages which are all flooded with
5 > CRLFs that you need to convert.
6 >
7 > That's why I'm suggesting to make edos2unix recursive. The posted patch
8 > changes the function to use find+sed for the substitution, passing given
9 > paths as the 'path' arguments to find.
10 >
11 > Whenever files are passed, nothing changes for ebuilds. If a directory
12 > is passed, find converts it recursively. The only potential breakage is
13 > when a non-file was passed and something weird was expected of it.
14 >
15 > Any thoughts? If nobody opposes, I will commit the patch in 7 days.
16 >
17
18 If used improperly, this could easily end up breaking binary files
19 that happen to contain the '\r' byte. Maybe a DEPEND on dos2unix would
20 be a better option in the case where many files must be converted.
21
22 I don't think it is necessary to convert DOS text files unless they
23 somehow break on a UNIX system. Shell scripts are a good example, as
24 well as some autotools files. No need to convert README though.
25
26 I would guess that this patch is a response to bug 465790. I'm ok with
27 requiring that python scripts be in UNIX format, although the python
28 interpreter seems to work with either format.