summaryrefslogtreecommitdiffstats
path: root/libcompat
diff options
context:
space:
mode:
authorArwed v. Merkatz2006-11-19 11:45:49 +0100
committerArwed v. Merkatz2006-11-19 11:45:49 +0100
commit885974c646dbd98f58ec9bb5f00d3d7a23c496f6 (patch)
treec3e23d6559675f0b54204320dba3971ff49008a0 /libcompat
parenteb5348f16c7a3843090a4c3e25e4a10e88bcdb49 (diff)
added is_depends_enabled function to libcompat
Diffstat (limited to 'libcompat')
-rwxr-xr-xlibcompat12
1 files changed, 12 insertions, 0 deletions
diff --git a/libcompat b/libcompat
index f900c371c6..b654e6e7f7 100755
--- a/libcompat
+++ b/libcompat
@@ -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
+}