lib/scripts/getsettings
changeset 61159 da900891ee06
parent 60531 9cc91b8a6489
child 61293 876e7eae22be
equal deleted inserted replaced
61158:ea6a4c8bc722 61159:da900891ee06
   238 #init component forest
   238 #init component forest
   239 function init_components ()
   239 function init_components ()
   240 {
   240 {
   241   local BASE="$1"
   241   local BASE="$1"
   242   local CATALOG="$2"
   242   local CATALOG="$2"
       
   243   local COMPONENT=""
       
   244   local -a COMPONENTS=()
   243 
   245 
   244   if [ ! -f "$CATALOG" ]; then
   246   if [ ! -f "$CATALOG" ]; then
   245     echo >&2 "Bad component catalog file: \"$CATALOG\""
   247     echo >&2 "Bad component catalog file: \"$CATALOG\""
   246     exit 2
   248     exit 2
   247   fi
   249   fi
       
   250 
   248   {
   251   {
   249     while { unset REPLY; read -r; test "$?" = 0 -o -n "$REPLY"; }
   252     while { unset REPLY; read -r; test "$?" = 0 -o -n "$REPLY"; }
   250     do
   253     do
   251       case "$REPLY" in
   254       case "$REPLY" in
   252         \#* | "") ;;
   255         \#* | "") ;;
   253         /*) init_component "$REPLY" ;;
   256         /*) COMPONENTS["${#COMPONENTS[@]}"]="$REPLY" ;;
   254         *) init_component "$BASE/$REPLY" ;;
   257         *) COMPONENTS["${#COMPONENTS[@]}"]="$BASE/$REPLY" ;;
   255       esac
   258       esac
   256     done
   259     done
   257   } < "$CATALOG"
   260   } < "$CATALOG"
       
   261 
       
   262   for COMPONENT in "${COMPONENTS[@]}"
       
   263   do
       
   264     init_component "$COMPONENT"
       
   265   done
   258 }
   266 }
   259 
   267 
   260 #main components
   268 #main components
   261 init_component "$ISABELLE_HOME"
   269 init_component "$ISABELLE_HOME"
   262 [ -d "$ISABELLE_HOME/Admin" ] && init_component "$ISABELLE_HOME/Admin"
   270 [ -d "$ISABELLE_HOME/Admin" ] && init_component "$ISABELLE_HOME/Admin"