blob: a8387572e79d16921ee502b9876793a8f22d4410 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
<?xml version="1.0" encoding="UTF-8"?>
<guide self="ebuild-writing/functions/pkg_pretend/">
<chapter>
<title>pkg_pretend</title>
<body>
<table>
<tr>
<th>Function</th>
<ti><c>pkg_pretend</c></ti>
</tr>
<tr>
<th>Purpose</th>
<ti>run sanity checks for a package during dependency calculation time</ti>
</tr>
<tr>
<th>Sandbox</th>
<ti>?</ti>
</tr>
<tr>
<th>Privilege</th>
<ti>root</ti>
</tr>
<tr>
<th>Called for</th>
<ti>ebuild, binary</ti>
</tr>
<tr>
<th>EAPI</th>
<ti>4</ti>
</tr>
</table>
</body>
<section>
<title>Default <c>pkg_pretend</c></title>
<body>
<codesample lang="ebuild">
pkg_pretend() {
return
}
</codesample>
</body>
</section>
<section>
<title>Sample <c>pkg_pretend</c></title>
<body>
<codesample lang="ebuild">
pkg_pretend() {
if use kernel_linux ; then
if [[ -e "${ROOT}"/usr/src/linux/.config ]] ; then
if kernel_is lt 2 6 30 ; then
CONFIG_CHECK="FUSE_FS"
ERROR_FUSE_FS="this is an unrealistic testcase..."
check_extra_config
fi
fi
fi
}
</codesample>
</body>
</section>
<section>
<title>Notes on <c>pkg_pretend</c></title>
<body>
<p>
The <c>pkg_pretend</c> phase can be used to do sanity checks
before the main phase function sequence is run (meaning this phase is
executed after the package manager has calculated the dependencies
and before installing them).
This phase typically checks for a kernel configuration and may
<c>eerror</c> and <c>die</c> when needed.
</p>
<important>
There is no guarantee that the ebuild's dependencies are installed
when this phase is called.
</important>
<important>
As <c>pkg_pretend</c> is not called in the main phase function
sequence, environment saving is not guaranteed.
</important>
</body>
</section>
</chapter>
</guide>
|