blob: 736a7daba2b4b8686bb54c04c8fc6894e46ab144 (
plain) (
blame)
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
|
# should be removed once bug #13673 and this is all in stable sorcery
PERL_CPAN_URL=${PERL_CPAN_URL:-http://www.cpan.org}
# ignore sub_depends if not supported by sorcery
declare -f sub_depends &> /dev/null ||
{
function sub_depends() {
:
}
function depends() {
[[ $1 == "-sub" ]] && shift 2
real_depends "$@"
}
function optional_depends() {
[[ $1 == "-sub" ]] && shift 2
real_optional_depends "$@"
}
}
# ignore force_depends if not supported by sorcery
declare -f force_depends &> /dev/null ||
function force_depends() {
:
}
#-------------------------------------------------------------------------
## Grimoire gaze depends alternative
## Uses gaze depends if the internal sorcery function isn't available
#-------------------------------------------------------------------------
declare -f show_up_depends &> /dev/null ||
function show_up_depends() {
gaze -q depends --fast "$@"
}
# fall back to optional_depends if suggest_depends isn't implemented
# OR fall back to true - this is needed to avoid some circular dependencies
# see #13244 for an example
if declare -f suggest_depends &> /dev/null; then
function suggest_depends_2() {
suggest_depends "$@"
}
else
function suggest_depends() {
optional_depends "$@"
}
function suggest_depends_2() {
true
}
fi
# fall back to depends if runtime_depends isn't implemented
if declare -f runtime_depends &> /dev/null; then
function runtime_depends_2() {
runtime_depends "$@"
}
else
function runtime_depends() {
depends "$@"
}
function runtime_depends_2() {
true
}
fi
declare -f is_depends_enabled &>/dev/null ||
function is_depends_enabled() {
local dep_status
if [[ $3 ]] ; then
dep_status=$DEPENDS_STATUS
else
dep_status=$(hash_get uncommitted_hash $1)
[[ $dep_status ]] || dep_status=$DEPENDS_STATUS
fi
grep -q "^[[:space:]]*$1:$2:on" $dep_status
}
|