Admin/init
changeset 73584 1d4c9fa00821
parent 73517 d3f2038198ae
child 73588 a96de8bbe8a3
equal deleted inserted replaced
73583:ed5226fdf89d 73584:1d4c9fa00821
    19   echo
    19   echo
    20   echo "Usage: Admin/init [OPTIONS]"
    20   echo "Usage: Admin/init [OPTIONS]"
    21   echo
    21   echo
    22   echo "  Options are:"
    22   echo "  Options are:"
    23   echo "    -C           force clean working directory (no backup!)"
    23   echo "    -C           force clean working directory (no backup!)"
       
    24   echo "    -L           local history only: no pull from repository server"
    24   echo "    -R           version is current official release"
    25   echo "    -R           version is current official release"
    25   echo "    -U URL       Isabelle repository server"
    26   echo "    -U URL       Isabelle repository server"
    26   echo "                 (default: \"$ISABELLE_REPOS\")"
    27   echo "                 (default: \"$ISABELLE_REPOS\")"
    27   echo "    -V PATH      version from explicit file, or directory that contains"
    28   echo "    -V PATH      version is taken from file, or directory"
    28   echo "                 the file \"ISABELLE_VERSION\""
    29   echo "                 with file \"ISABELLE_VERSION\""
    29   echo "    -c           check clean working directory"
    30   echo "    -c           check clean working directory"
    30   echo "    -f           fresh build of Isabelle/Scala/jEdit"
    31   echo "    -f           fresh build of Isabelle/Scala/jEdit"
    31   echo "    -n           no build of Isabelle/Scala/jEdit"
    32   echo "    -n           no build of Isabelle/Scala/jEdit"
    32   echo "    -r REV       version in Mercurial notation (changeset id or tag)"
    33   echo "    -r REV       version given in Mercurial notation (changeset id or tag)"
    33   echo "    -u           version is latest tip from repository server or local clone"
    34   echo "    -t           version is latest tip"
    34   echo
    35   echo
    35   echo "  Initialize the current ISABELLE_HOME directory, which needs to be a"
    36   echo "  Initialize the current ISABELLE_HOME directory, which needs to be a"
    36   echo "  repository clone (all versions) or repository archive (fixed version)."
    37   echo "  repository clone (all versions) or repository archive (fixed version)."
    37   echo "  Download required components. Build Isabelle/Scala/jEdit by default."
    38   echo "  Download required components. Build Isabelle/Scala/jEdit by default."
    38   echo
    39   echo
    49 ## process command line
    50 ## process command line
    50 
    51 
    51 #options
    52 #options
    52 
    53 
    53 BUILD_OPTIONS="-b"
    54 BUILD_OPTIONS="-b"
       
    55 PULL="true"
    54 
    56 
    55 CLEAN_FORCE=""
    57 CLEAN_FORCE=""
    56 CLEAN_CHECK=""
    58 CLEAN_CHECK=""
    57 
    59 
    58 VERSION=""
    60 VERSION=""
    59 VERSION_RELEASE=""
    61 VERSION_RELEASE=""
    60 VERSION_PATH=""
    62 VERSION_PATH=""
    61 VERSION_REV=""
    63 VERSION_REV=""
    62 
    64 
    63 while getopts "CRU:V:cfnr:u" OPT
    65 while getopts "CLRU:V:cfnr:t" OPT
    64 do
    66 do
    65   case "$OPT" in
    67   case "$OPT" in
    66     C)
    68     C)
    67       CLEAN_FORCE="--clean"
    69       CLEAN_FORCE="--clean"
       
    70       ;;
       
    71     L)
       
    72       PULL=""
    68       ;;
    73       ;;
    69     R)
    74     R)
    70       VERSION="true"
    75       VERSION="true"
    71       VERSION_RELEASE="true"
    76       VERSION_RELEASE="true"
    72       VERSION_PATH=""
    77       VERSION_PATH=""
    94       VERSION="true"
    99       VERSION="true"
    95       VERSION_RELEASE=""
   100       VERSION_RELEASE=""
    96       VERSION_PATH=""
   101       VERSION_PATH=""
    97       VERSION_REV="$OPTARG"
   102       VERSION_REV="$OPTARG"
    98       ;;
   103       ;;
    99     u)
   104     t)
   100       VERSION="true"
   105       VERSION="true"
   101       VERSION_RELEASE=""
   106       VERSION_RELEASE=""
   102       VERSION_PATH=""
   107       VERSION_PATH=""
   103       VERSION_REV="tip"
   108       VERSION_REV="tip"
   104       ;;
   109       ;;
   149 
   154 
   150   export LANG=C
   155   export LANG=C
   151   export HGPLAIN=
   156   export HGPLAIN=
   152 
   157 
   153   #Atomic exec: avoid inplace update of running script!
   158   #Atomic exec: avoid inplace update of running script!
   154   export CLEAN_FORCE CLEAN_CHECK REV ISABELLE_REPOS BUILD_OPTIONS
   159   export PULL CLEAN_FORCE CLEAN_CHECK REV ISABELLE_REPOS BUILD_OPTIONS
   155   exec bash -c '
   160   exec bash -c '
   156     set -e
   161     set -e
   157     "${HG:-hg}" -R "$ISABELLE_HOME" pull -r "$REV" "$ISABELLE_REPOS"
   162     if [ -n "$PULL" ]; then
       
   163       "${HG:-hg}" -R "$ISABELLE_HOME" pull -r "$REV" "$ISABELLE_REPOS"
       
   164     fi
   158     "${HG:-hg}" -R "$ISABELLE_HOME" update -r "$REV" $CLEAN_FORCE $CLEAN_CHECK
   165     "${HG:-hg}" -R "$ISABELLE_HOME" update -r "$REV" $CLEAN_FORCE $CLEAN_CHECK
   159     "$ISABELLE_HOME/bin/isabelle" components -a
   166     "$ISABELLE_HOME/bin/isabelle" components -a
   160     if [ -n "$BUILD_OPTIONS" ]; then
   167     if [ -n "$BUILD_OPTIONS" ]; then
   161       "$ISABELLE_HOME/bin/isabelle" jedit $BUILD_OPTIONS
   168       "$ISABELLE_HOME/bin/isabelle" jedit $BUILD_OPTIONS
   162     fi
   169     fi