-
Notifications
You must be signed in to change notification settings - Fork 1
/
bashrc
56 lines (44 loc) · 934 Bytes
/
bashrc
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
#!/bin/bash
#
# Runs extra code per phase.
_run_hooks() {
local hook basedir hook
phase="$1"
basedir="/etc/portage/hooks"
einfo "Running ${phase} hooks"
if [[ -d ${basedir}/${phase}.d/ ]]; then
for hook in ${basedir}/${phase}.d/* ; do
if [[ -x ${hook} ]]; then
einfo " ${phase} hook: $(basename ${hook})"
${hook} $@ || return 1
fi
done
else
:
fi
return 0
}
post_src_unpack() {
if has ${EAPI:-0} 0 1; then
_run_hooks post_src_prepare
fi
}
post_src_prepare() {
[[ -d ${S} ]] && return
_run_hooks post_src_prepare
}
pre_src_configure() {
einfo "Calling pre_src_configure"
if [[ -f ${ECONF_SOURCE:-.}/configure ]] && grep -q "silent-rules" ${ECONF_SOURCE:-.}/configure ; then
EXTRA_ECONF="${EXTRA_ECONF} --enable-silent-rules"
fi
}
post_src_compile() {
_run_hooks post_src_compile
}
post_src_install() {
_run_hooks post_src_install
}
pre_pkg_preinst() {
_run_hooks pre_pkg_preinst
}