diff options
author | Arwed v. Merkatz | 2006-11-19 11:45:49 +0100 |
---|---|---|
committer | Arwed v. Merkatz | 2006-11-19 11:45:49 +0100 |
commit | 885974c646dbd98f58ec9bb5f00d3d7a23c496f6 (patch) | |
tree | c3e23d6559675f0b54204320dba3971ff49008a0 /libcompat | |
parent | eb5348f16c7a3843090a4c3e25e4a10e88bcdb49 (diff) |
added is_depends_enabled function to libcompat
Diffstat (limited to 'libcompat')
-rwxr-xr-x | libcompat | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -53,3 +53,15 @@ declare -f runtime_depends &> /dev/null || function runtime_depends() { depends "$@" } + +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 +} |