lib/Tools/build
changeset 60106 e0d1d9203275
parent 59892 2a616319c171
child 61131 83459eb76fe3
--- a/lib/Tools/build	Fri Apr 17 09:56:12 2015 +0200
+++ b/lib/Tools/build	Fri Apr 17 11:28:57 2015 +0200
@@ -28,6 +28,7 @@
   echo "  Options are:"
   echo "    -D DIR       include session directory and select its sessions"
   echo "    -R           operate on requirements of selected sessions"
+  echo "    -X NAME      exclude sessions from group NAME and all descendants"
   echo "    -a           select all sessions"
   echo "    -b           build heap images"
   echo "    -c           clean build"
@@ -40,7 +41,7 @@
   echo "    -o OPTION    override Isabelle system OPTION (via NAME=VAL or NAME)"
   echo "    -s           system build mode: produce output in ISABELLE_HOME"
   echo "    -v           verbose"
-  echo "    -x SESSION   exclude SESSION and all its descendants"
+  echo "    -x NAME      exclude session NAME and all descendants"
   echo
   echo "  Build and manage Isabelle sessions, depending on implicit"
   show_settings "  "
@@ -64,6 +65,7 @@
 
 declare -a SELECT_DIRS=()
 REQUIREMENTS=false
+declare -a EXCLUDE_SESSION_GROUPS=()
 ALL_SESSIONS=false
 BUILD_HEAP=false
 CLEAN_BUILD=false
@@ -78,7 +80,7 @@
 VERBOSE=false
 declare -a EXCLUDE_SESSIONS=()
 
-while getopts "D:Rabcd:g:j:k:lno:svx:" OPT
+while getopts "D:RX:abcd:g:j:k:lno:svx:" OPT
 do
   case "$OPT" in
     D)
@@ -87,6 +89,9 @@
     R)
       REQUIREMENTS="true"
       ;;
+    X)
+      EXCLUDE_SESSION_GROUPS["${#EXCLUDE_SESSION_GROUPS[@]}"]="$OPTARG"
+      ;;
     a)
       ALL_SESSIONS="true"
       ;;
@@ -156,7 +161,8 @@
   "$LIST_FILES" "$NO_BUILD" "$SYSTEM_MODE" "$VERBOSE" \
   "${INCLUDE_DIRS[@]}" $'\n' "${SELECT_DIRS[@]}" $'\n' \
   "${SESSION_GROUPS[@]}" $'\n' "${CHECK_KEYWORDS[@]}" $'\n' \
-  "${BUILD_OPTIONS[@]}" $'\n' "${EXCLUDE_SESSIONS[@]}" $'\n' "$@"
+  "${BUILD_OPTIONS[@]}" $'\n' "${EXCLUDE_SESSION_GROUPS[@]}" $'\n' \
+  "${EXCLUDE_SESSIONS[@]}" $'\n' "$@"
 RC="$?"
 
 if [ "$NO_BUILD" = false -a "$VERBOSE" = true ]; then