summaryrefslogtreecommitdiffstats
path: root/libcompat
diff options
context:
space:
mode:
authorruskie2007-01-06 13:20:53 +0100
committerruskie2007-01-06 13:20:53 +0100
commit7a431c0d6d646034995b35230b77d23b6e6cf623 (patch)
treef55ebeb2caeaf1faacbaea620cb6107e774bae9c /libcompat
parent6f367259a04a43e8ce2a338205b8ea82d958c616 (diff)
synced libcompat with test
Diffstat (limited to 'libcompat')
-rwxr-xr-xlibcompat31
1 files changed, 27 insertions, 4 deletions
diff --git a/libcompat b/libcompat
index 515697fdef..b654e6e7f7 100755
--- a/libcompat
+++ b/libcompat
@@ -32,13 +32,36 @@ function show_up_depends() {
}
# fall back to optional_depends if suggest_depends isn't implemented
-declare -f suggest_depends &> /dev/null ||
-function suggest_depends() {
- optional_depends "$@"
-}
+# 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
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
+}