From ca8c43bdd43b2b37cd7cd26f89f1ee02dfd57a20 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Thu, 2 Dec 2021 06:10:02 +0100 Subject: [PATCH] Add depends-on modulefile command Introduce the depends-on modulefile command which defines module requirements for currently loading modulefile. This command is an alias over prereq command with all modulefile arguments treated as a Boolean AND operation: all specified modulefiles are required. --- tcl/mfinterp.tcl.in | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tcl/mfinterp.tcl.in b/tcl/mfinterp.tcl.in index 9716475a..7d9a3be4 100644 --- a/tcl/mfinterp.tcl.in +++ b/tcl/mfinterp.tcl.in @@ -93,6 +93,7 @@ add-property {nop nop nop nop nop append-path {append-path append-path-un append-path append-path append-path edit-path-wh nop } chdir {chdir nop reportCmd nop nop nop nop } conflict {conflict nop reportCmd nop nop nop nop } +depends-on {depends-on nop reportCmd nop nop nop nop } extensions {nop nop nop nop nop nop nop } module {module module reportCmd nop nop nop nop } module-alias {module-alias module-alias module-alias module-alias module-alias module-alias nop } @@ -2452,6 +2453,16 @@ proc require-fullname {} { } } +proc depends-on {args} { + if {[llength $args] == 0} { + knerror {wrong # args: should be "depends-on modulefile ?...?"} + } + # call prereq over each arg independently to emulate a prereq-all + foreach arg $args { + prereq $arg + } +} + # ;;; Local Variables: *** # ;;; mode:tcl *** # ;;; End: ***