sm-discuss AT lists.ibiblio.org
Subject: Public SourceMage Discussion List
List archive
[SM-Discuss] [RFC] libdepends: Automagic sub-dependens implementation
- From: Ismael Luceno <ismael.luceno AT gmail.com>
- To: sm-discuss AT lists.ibiblio.org
- Cc: Ismael Luceno <ismael AT sourcemage.org>
- Subject: [SM-Discuss] [RFC] libdepends: Automagic sub-dependens implementation
- Date: Fri, 5 Aug 2016 15:44:49 -0300
From: Ismael Luceno <ismael AT sourcemage.org>
Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
---
var/lib/sorcery/modules/libdepends | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/var/lib/sorcery/modules/libdepends
b/var/lib/sorcery/modules/libdepends
index 53737a5baaa1..a38e06c3ef66 100755
--- a/var/lib/sorcery/modules/libdepends
+++ b/var/lib/sorcery/modules/libdepends
@@ -262,6 +262,9 @@ function process_sub_depends() {
local THIS_SUB_DEPENDS=$sub_depends
local PROCESSED_SUB_DEPENDS
hash_get_ref processed_sub_depends $sub_dependee PROCESSED_SUB_DEPENDS
+ [[ ${sub_depends:0:1} == @ ]] &&
+ message "${MESSAGE_COLOR}Automagic sub-dependency" \
+ "@$SPELL_COLOR${sub_depends:1}$MESSAGE_COLOR
requested.$DEFAULT_COLOR"
run_spell_file SUB_DEPENDS sub_depends || return 1
hash_append processed_sub_depends $sub_dependee $sub_depends
else
@@ -1463,6 +1466,15 @@ function real_sub_depends() {
if ! tablet_set_spell $sub_dependee ; then
codex_set_current_spell_by_name $sub_dependee || return 1
fi
+ # Automagic sub-depends
+ if [[ ${sub_depends:0:1} == @ ]] &&
+ grep -q "^$sub_dependee:${sub_depends:1}:" "$SPELL_DIRECTORY"/depends
+ then
+ message "${MESSAGE_COLOR}Automagic sub-dependency" \
+ "@$SPELL_COLOR${sub_depends:1}$MESSAGE_COLOR
found.$DEFAULT_COLOR"
+ is_depends_enabled "$sub_dependee" "$sub_depends"
+ return
+ fi
run_spell_file PRE_SUB_DEPENDS pre_sub_depends
rc=$?
return $rc
--
2.9.2
- [SM-Discuss] [RFC] libdepends: Automagic sub-dependens implementation, Ismael Luceno, 08/05/2016
Archive powered by MHonArc 2.6.24.