summaryrefslogtreecommitdiffstats
path: root/libcompat
diff options
context:
space:
mode:
authorEric Sandall2006-09-02 01:05:21 -0700
committerEric Sandall2006-09-02 01:05:21 -0700
commit16b9c5b2fa4168669644348548b77c4786d9c253 (patch)
tree5e7f2cd57b6b5e7e61f94d3e90c3378e84e79b5f /libcompat
parent8cd99c30faebe48046822a6695c0a5f05751f715 (diff)
Add missing libcompat for non-devel Sorcery and sub_depends
Diffstat (limited to 'libcompat')
-rwxr-xr-xlibcompat44
1 files changed, 44 insertions, 0 deletions
diff --git a/libcompat b/libcompat
new file mode 100755
index 0000000000..515697fdef
--- /dev/null
+++ b/libcompat
@@ -0,0 +1,44 @@
+# 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
+declare -f suggest_depends &> /dev/null ||
+function suggest_depends() {
+ optional_depends "$@"
+}
+
+# fall back to depends if runtime_depends isn't implemented
+declare -f runtime_depends &> /dev/null ||
+function runtime_depends() {
+ depends "$@"
+}