simplified quick start via "isabelle components -I";
authorwenzelm
Mon Dec 31 15:56:17 2012 +0100 (2012-12-31)
changeset 506535c85f8b80b95
parent 50652 ead5714cc480
child 50654 3356ff213339
simplified quick start via "isabelle components -I";
README_REPOSITORY
lib/Tools/components
src/Doc/System/Misc.thy
     1.1 --- a/README_REPOSITORY	Mon Dec 31 14:58:21 2012 +0100
     1.2 +++ b/README_REPOSITORY	Mon Dec 31 15:56:17 2012 +0100
     1.3 @@ -4,28 +4,25 @@
     1.4  Quick start in 25min
     1.5  --------------------
     1.6  
     1.7 -1a. Windows: ensure that Cygwin with Mercurial and Perl is installed;
     1.8 -   see also http://www.cygwin.com/
     1.9 -
    1.10 -1b. Mac OS X and Linux: ensure that Mercurial (hg) is installed; see
    1.11 +1a. Linux and Mac OS X: ensure that Mercurial (hg) is installed; see
    1.12     also http://www.selenic.com/mercurial
    1.13  
    1.14 -2. Create file $HOME/.isabelle/etc/settings and insert the following
    1.15 -   line near its beginning:
    1.16 +1b. Windows: ensure that Cygwin with Mercurial and Perl is installed;
    1.17 +   see also http://www.cygwin.com/
    1.18  
    1.19 -    init_components "$HOME/.isabelle/contrib" "$ISABELLE_HOME/Admin/components/main"
    1.20 -
    1.21 -3. Execute bash shell commands as follows:
    1.22 +2. Clone repository (bash shell commands):
    1.23  
    1.24      hg clone http://isabelle.in.tum.de/repos/isabelle
    1.25  
    1.26      cd isabelle
    1.27  
    1.28 +    ./bin/isabelle components -I
    1.29 +
    1.30      ./bin/isabelle components -a
    1.31  
    1.32      ./bin/isabelle jedit -l HOL
    1.33  
    1.34 -4. To stay up-to-date later on, pull changes like this:
    1.35 +3. Update repository (bash shell commands):
    1.36  
    1.37      cd isabelle
    1.38  
     2.1 --- a/lib/Tools/components	Mon Dec 31 14:58:21 2012 +0100
     2.2 +++ b/lib/Tools/components	Mon Dec 31 15:56:17 2012 +0100
     2.3 @@ -15,6 +15,7 @@
     2.4    echo "Usage: isabelle $PRG [OPTIONS] [COMPONENTS ...]"
     2.5    echo
     2.6    echo "  Options are:"
     2.7 +  echo "    -I           init user settings"
     2.8    echo "    -R URL       component repository (default \$ISABELLE_COMPONENT_REPOSITORY)"
     2.9    echo "    -a           all missing components"
    2.10    echo "    -l           list status"
    2.11 @@ -38,13 +39,17 @@
    2.12  
    2.13  #options
    2.14  
    2.15 +INIT_SETTINGS=""
    2.16  COMPONENT_REPOSITORY="$ISABELLE_COMPONENT_REPOSITORY"
    2.17  ALL_MISSING=""
    2.18  LIST_ONLY=""
    2.19  
    2.20 -while getopts "R:al" OPT
    2.21 +while getopts "IR:al" OPT
    2.22  do
    2.23    case "$OPT" in
    2.24 +    I)
    2.25 +      INIT_SETTINGS="true"
    2.26 +      ;;
    2.27      R)
    2.28        COMPONENT_REPOSITORY="$OPTARG"
    2.29        ;;
    2.30 @@ -65,7 +70,7 @@
    2.31  
    2.32  # args
    2.33  
    2.34 -[ "$#" -eq 0 -a -z "$ALL_MISSING" -a -z "$LIST_ONLY" ] && usage
    2.35 +[ "$#" -eq 0 -a -z "$INIT_SETTINGS" -a -z "$ALL_MISSING" -a -z "$LIST_ONLY" ] && usage
    2.36  
    2.37  if [ -z "$ALL_MISSING" ]; then
    2.38    splitarray ":" "$@"
    2.39 @@ -80,7 +85,23 @@
    2.40  splitarray ":" "$ISABELLE_COMPONENTS"; declare -a AVAILABLE_COMPONENTS=("${SPLITARRAY[@]}")
    2.41  splitarray ":" "$ISABELLE_COMPONENTS_MISSING"; declare -a MISSING_COMPONENTS=("${SPLITARRAY[@]}")
    2.42  
    2.43 -if [ -n "$LIST_ONLY" ]; then
    2.44 +if [ -n "$INIT_SETTINGS" ]; then
    2.45 +  SETTINGS="$ISABELLE_HOME_USER/etc/settings"
    2.46 +  SETTINGS_CONTENT='init_components "$USER_HOME/.isabelle/contrib" "$ISABELLE_HOME/Admin/components/main"'
    2.47 +  if [ -e "$SETTINGS" ]; then
    2.48 +    echo "User settings file already exists!"
    2.49 +    echo
    2.50 +    echo "Edit \"$SETTINGS\" manually"
    2.51 +    echo "and add the following line near its start:"
    2.52 +    echo
    2.53 +    echo "  $SETTINGS_CONTENT"
    2.54 +    echo
    2.55 +  else
    2.56 +    echo "Initializing \"$SETTINGS\""
    2.57 +    mkdir -p "$(dirname "$SETTINGS")"
    2.58 +    echo "$SETTINGS_CONTENT" > "$SETTINGS"
    2.59 +  fi
    2.60 +elif [ -n "$LIST_ONLY" ]; then
    2.61    echo
    2.62    echo "Available components:"
    2.63    for NAME in "${AVAILABLE_COMPONENTS[@]}"; do echo "  $NAME"; done
     3.1 --- a/src/Doc/System/Misc.thy	Mon Dec 31 14:58:21 2012 +0100
     3.2 +++ b/src/Doc/System/Misc.thy	Mon Dec 31 15:56:17 2012 +0100
     3.3 @@ -18,6 +18,7 @@
     3.4  Usage: isabelle components [OPTIONS] [COMPONENTS ...]
     3.5  
     3.6    Options are:
     3.7 +    -I           init user settings
     3.8      -R URL       component repository
     3.9                   (default $ISABELLE_COMPONENT_REPOSITORY)
    3.10      -a           all missing components
    3.11 @@ -49,7 +50,14 @@
    3.12  
    3.13    Option @{verbatim "-l"} lists the current state of available and
    3.14    missing components with their location (full name) within the
    3.15 -  file-system.  *}
    3.16 +  file-system.
    3.17 +
    3.18 +  Option @{verbatim "-I"} initializes the user settings file to
    3.19 +  subscribe to the standard components specified in the Isabelle
    3.20 +  repository clone --- this does not make any sense for regular
    3.21 +  Isabelle releases.  If the file already exists, it needs to be
    3.22 +  edited manually according to the printed explanation.
    3.23 +*}
    3.24  
    3.25  
    3.26  section {* Displaying documents *}