Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [Future EAPI] src_fetch() phase function to support VCS fetching
Date: Tue, 04 Sep 2012 16:43:57
Message-Id: 20120904184345.77696965@pomiocik.lan
1 Hello,
2
3 As Sid Hayn raised today on #gentoo-portage, it would be useful to
4 finally have portage able to fetch updates from VCS-es independently
5 of src_unpack(). This could be used, for example, on machines
6 temporarily connected to the network -- one would then fetch files
7 while connected to the network, and perform the updates later.
8
9 There are a few ways how we could handle that but the cleanest and most
10 universal one seems to be defining a src_fetch() phase function
11 in a future EAPI.
12
13 In the EAPIs supporting src_fetch(), that phase function would be used
14 by PM when requesting the files to be fetched. A default_src_fetch()
15 will be declared as well, providing implementation-defined code
16 fetching files like they are fetched now. Older EAPIs will simply
17 always use that default.
18
19 The phase function would be disjoint from the normal merge process,
20 much like pkg_pretend(). In portage, it will be called as 'portage'
21 user if FEATURES=userfetch is enabled.
22
23 VCS eclasses supporting separated fetching would define two phase
24 functions:
25 - src_fetch() which would be responsible for fetching updates,
26 - src_unpack() which would be responsible for checking out the source
27 to work directory.
28
29 The remaining issue is handling dependencies on the tools necessary to
30 do fetching. For default_src_fetch(), we can assume that the package
31 manager provides the necessary tools. For custom src_fetch(), we would
32 need either to:
33
34 1) require satisfying whole DEPEND when fetching -- probably pointless,
35 as it will make --fetchonly almost impossible when doing initial
36 installs;
37
38 2) introduce a new dependency type (please do not get into details how
39 we do it -- we will discuss that another time, at the moment please
40 just keep it as 'new dependency type') -- and we probably end up
41 having a switch for --fetchonly without installing deps (thus
42 omitting packages where they are not satisfied), and with deps;
43
44 3) [ugly!] assume that src_fetch() should check for its deps and fail
45 if they are not satisfied. If that's mostly for live ebuilds, it may
46 be acceptable. Then the package manager will just have one 'fetch
47 failed' on --fetchonly (or early pre-fetch), and it will have to
48 invoke src_fetch() after satisfying the deps, before src_unpack().
49
50 What do you think? What are your ideas, suggestions?
51
52 --
53 Best regards,
54 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies