summaryrefslogtreecommitdiffstats
path: root/is_depends_enabled.function
blob: 6b542091228cc8288c9eccf26b4b099d4e68f53a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#
## This is here temporarily until is_depends_enabled is integrated to 
## stable sorcery. Before that this needs to be sourced by spells which 
## use is_depends_enabled.
#
if ! declare -f is_depends_enabled &>/dev/null; then
  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
  }
fi