[Lunar-commits] <lunar> optional_depends recommended choice

Peter de Ridder peter at lunar-linux.org
Sat Oct 26 19:22:34 CEST 2013


commit 07c3b54acaa6be7e1d1381c85f8c8ba8d0273555
Author: Peter de Ridder <peter at lunar-linux.org>
Date: Tue, 22 Oct 2013 10:57:13 -0700
URL: https://github.com/lunar-linux/lunar/commit/07c3b54acaa6be7e1d1381c85f8c8ba8d0273555

optional_depends recommended choice

Add an optional 5th option to set the default choice for
optional_depends.
---
  libs/depends.lunar | +3/-2     
  1 file changed, 3 insertions(+), 2 deletions(-)

--- a/libs/depends.lunar
+++ b/libs/depends.lunar
@@ -213,6 +213,7 @@ run_depends() {
     #              $2 = configure parameter if module wanted
     #              $3 = configure parameter if module declined
     #              $4 = description of why to use this module
+    #              $5 = optional default choice (recommended)
 
     DEP=$(unalias $1)
     if in_depends $MODULE $DEP ; then
@@ -231,10 +232,10 @@ run_depends() {
         add_depends "$MODULE" "$DEP" "off" "optional" "$2" "$3"
       else
         if module_installed $DEP ; then
-          DEFAULT="y"
+          DEFAULT="${5:-y}"
           DEPMOD_AVAIL="Use optional (${FILE_COLOR}installed${QUERY_COLOR}) module ${MODULE_COLOR}$DEP${DEFAULT_COLOR}${MESSAGE_COLOR}"
         else
-          DEFAULT="n"
+          DEFAULT="${5:-n}"
           DEPMOD_AVAIL="Install & use optional (${PROBLEM_COLOR}not installed${QUERY_COLOR}) module ${MODULE_COLOR}$DEP${DEFAULT_COLOR}${MESSAGE_COLOR}"
         fi
 




More information about the Lunar-commits mailing list