Gentoo Archives: gentoo-pms

From: "Michał Górny" <mgorny@g.o>
To: David Leverton <levertond@××××××××××.com>
Cc: gentoo-pms@l.g.o
Subject: Re: [gentoo-pms] [PATCH 05/22] EAPI 6 supports package.* and use.* directories.
Date: Thu, 05 Nov 2015 22:14:11
Message-Id: 20151105231402.6d62f05e.mgorny@gentoo.org
In Reply to: Re: [gentoo-pms] [PATCH 05/22] EAPI 6 supports package.* and use.* directories. by David Leverton
1 On Thu, 5 Nov 2015 18:38:58 +0000
2 David Leverton <levertond@××××××××××.com> wrote:
3
4 > Ulrich Müller wrote:
5 > > +\featurelabel{profile-file-dirs} For EAPIs listed as supported in table~\ref{tab:profile-file-dirs},
6 > > +simple line-based files described in the following sections may optionally be directories containing
7 > > +files of the named type.
8 >
9 > 1) Can those directories themselves contain subdirectories (and
10 > sub-subdirectories, ...), or is it just one level deep?
11 >
12 > 2) Is there any restriction on the names of the files (e.g. ignoring
13 > hidden files, editor backups, etc), or can they be anything?
14 >
15 > If I'm reading the current Portage implementation correctly, the answers
16 > there (without making any claims about what the spec should or shouldn't
17 > adopt) are:
18 >
19 > 1) Yes, there can be multiple levels of subdirectories.
20 >
21 > 2) Yes, files and subdirectories beginning with a . or ending with a ~
22 > are excluded, as are subdirectories named CVS, RCS or SCCS.
23
24 I think your understanding of Portage implementation is correct.
25 However, I don't really think spec should work like this.
26
27 1) I'd go for allowing a single recursion level only. If not for
28 anything specific, just to keep things simple and avoid further
29 questions like how to handle symlinks and avoid infinite recursion.
30 This would also be consistent with how 'eapply' is defined.
31
32 2) Dotfiles should be implicitly ignored since that's a common *nix
33 scheme. If not by any specific exclusion rule, just by simple '*' glob
34 that wouldn't match those files (this is what happens in eapply).
35
36 As for various backup files, I wouldn't put them in the spec. They
37 don't really belong in the committed repository anyway, so they should
38 be a minor concern for us.
39
40 Long story short, I think this should work alike:
41
42 [[ -d ${foo} ]] && handle "${foo}"/*
43
44 Therefore implying single level of recursion and skipping dotfiles.
45
46 --
47 Best regards,
48 Michał Górny
49 <http://dev.gentoo.org/~mgorny/>

Replies