Gentoo Archives: gentoo-dev

From: Martin Vaeth <martin@×××××.de>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: [RFC] multiversion ebuilds
Date: Wed, 16 May 2018 06:18:11
Message-Id: slrnpfnj8g.bqn.martin@clover.invalid
In Reply to: Re: [gentoo-dev] Re: [RFC] multiversion ebuilds by R0b0t1
1 R0b0t1 <r030t1@×××××.com> wrote:
2 > On Tue, May 15, 2018 at 11:15 PM, Duncan <1i5t5.duncan@×××.net> wrote:
3 >>
4 >> AFAIK symlinks aren't allowed in the gentoo tree [...]
5 >>
6 >> Tho perhaps that can be reevaluated. [...]
7 >
8 > Cygwin and MSYS(2) are currently mostly supported by Prefix [...]
9
10 For rsync users, the non-symlink policy is not necessary:
11 They could simply pass the option --copy-links to get a working
12 tree (of course, correspondingly longer).
13
14 For git users (essential for overlays!), I do not know a simple way.
15 It might be possible to set up appropriate git hooks, but that
16 might be tricky: The hooks would need to apply before the files
17 are actually checked out, and it might become even more tricky if
18 one does not want that subsequent git commands do consider the
19 transformation as a local modification.
20
21 For git perhaps an opposite approach might be easier: One could
22 provide hooks which every git user is supposed to use which manage
23 symlinks and/or copies.
24 More precisely, these hooks should have a symlink and a non-symlink
25 mode (depending on whether the underlying (file)system can generate
26 symlinks which can easily and quickly be detected), and the tree
27 would need to contain a symlinks.dat file with a list of symlinks,
28 and a .gitignore containing the symlinks.
29 During checkout, the hooks should simply generate the corresponding
30 symlinks/files (depending on symlinks.dat) according to the stored
31 list of symlinks.
32 During checkin in symlink mode, these hooks automatically update
33 symlinks.dat and .gitignore so that most developers simply can
34 use/modify symlinks transparently.
35 During checkin in non-symlink mode the hook does nothing:
36 Developers who checkin on filesystems without symlink have to update
37 these 2 files manually, of course, when they want to
38 create/remove/rename a symlink. Maybe one could provide
39 corresponding helper scripts for those developers with
40 non-symlink-aware filesystems if necessary.