proper usage message;
authorwenzelm
Thu Jul 17 21:07:17 2008 +0200 (2008-07-17 ago)
changeset 27645a1d7ee46387a
parent 27644 ddfba93b861f
child 27646 d010fc1d3c46
proper usage message;
more precise perl replacements;
less verbosity;
Admin/makedist_mercurial
     1.1 --- a/Admin/makedist_mercurial	Thu Jul 17 20:40:05 2008 +0200
     1.2 +++ b/Admin/makedist_mercurial	Thu Jul 17 21:07:17 2008 +0200
     1.3 @@ -28,14 +28,10 @@
     1.4    Options are:
     1.5      -r NAME         proper release with name"
     1.6  
     1.7 -  FIXME Make Isabelle distribution from the master sources at TUM.
     1.8 +  Make Isabelle distribution from the Mercurial repository at TUM.
     1.9  
    1.10 -  VERSION may be either a tag like "IsabelleXXXX" that specifies the
    1.11 -  release to be exported from the repository, or "-" to checkout the
    1.12 -  current sources as an unofficial release.
    1.13 -
    1.14 -  NAME specifies an explicit distribution name, by default it is
    1.15 -  derived from VERSION.
    1.16 +  VERSION identifies the snapshot, using usual Mercurial terminology;
    1.17 +  the default is "tip", or the proper release name if given.
    1.18  
    1.19  EOF
    1.20    exit 1
    1.21 @@ -71,12 +67,21 @@
    1.22  
    1.23  # args
    1.24  
    1.25 -VERSION="tip"
    1.26 +VERSION=""
    1.27  [ "$#" -gt 0 ] && { VERSION="$1"; shift; }
    1.28  
    1.29  [ "$#" -gt 0 ] && usage
    1.30  
    1.31  
    1.32 +# defaults
    1.33 +
    1.34 +if [ -z "$RELEASE" ]; then
    1.35 +  [ -z "$VERSION" ] && VERSION=tip
    1.36 +else
    1.37 +  [ -z "$VERSION" ] && VERSION="$RELEASE"
    1.38 +fi
    1.39 +
    1.40 +
    1.41  ## main
    1.42  
    1.43  # retrieve archive and resolve version identifier
    1.44 @@ -85,7 +90,7 @@
    1.45  cd "$DISTPREFIX/$TMP"
    1.46  
    1.47  echo "###"
    1.48 -echo "### Retrieving $REPOS/archive/${VERSION}.tar.gz"
    1.49 +echo "### Retrieving Mercurial snapshot ${VERSION}.tar.gz"
    1.50  echo "###"
    1.51  
    1.52  { wget -q "$REPOS/archive/${VERSION}.tar.gz" && tar -x -z -f "${VERSION}.tar.gz"; } || \
    1.53 @@ -94,8 +99,8 @@
    1.54  rm "${VERSION}.tar.gz"
    1.55  IDENT=$(echo * | sed 's/Isabelle-repository-//')
    1.56  
    1.57 -rm "Isabelle-repository-$IDENT/.hg_archival.txt"
    1.58 -rm "Isabelle-repository-$IDENT/.hgtags"
    1.59 +rm -f "Isabelle-repository-$IDENT/.hg_archival.txt"
    1.60 +rm -f "Isabelle-repository-$IDENT/.hgtags"
    1.61  
    1.62  
    1.63  # dist name
    1.64 @@ -170,14 +175,14 @@
    1.65      echo
    1.66    } >ANNOUNCE
    1.67  else
    1.68 -  perl -pi -e "s/val is_official = false/val is_official = true/" src/Pure/ROOT.ML
    1.69 +  perl -pi -e "s,val is_official = false,val is_official = true,g" src/Pure/ROOT.ML
    1.70  fi
    1.71  
    1.72 -perl -pi -e "s/val changelog = \"\"/val changelog = \"$REPOS/log/$IDENT\"/" src/Pure/ROOT.ML
    1.73 -perl -pi -e "s/ISABELLE_IDENTIFIER=\"\"/ISABELLE_IDENTIFIER=\"$DISTNAME\"/g;" lib/scripts/getsettings
    1.74 -perl -pi -e "s/{ISABELLE}/$DISTNAME/g;" lib/html/library_index_header.template
    1.75 -perl -pi -e "s/Isabelle repository version/$DISTVERSION/" src/Pure/ROOT.ML lib/Tools/version
    1.76 -perl -pi -e "s/the internal repository version of Isabelle/$DISTVERSION/" README
    1.77 +perl -pi -e "s,val changelog = \"\",val changelog = \"$REPOS/log/$IDENT\",g" src/Pure/ROOT.ML
    1.78 +perl -pi -e "s,ISABELLE_IDENTIFIER=\"\",ISABELLE_IDENTIFIER=\"$DISTNAME\",g" lib/scripts/getsettings
    1.79 +perl -pi -e "s,{ISABELLE},$DISTNAME,g" lib/html/library_index_header.template
    1.80 +perl -pi -e "s,Isabelle repository version,$DISTVERSION,g" src/Pure/ROOT.ML lib/Tools/version
    1.81 +perl -pi -e "s,the internal repository version of Isabelle,$DISTVERSION,g" README
    1.82  
    1.83  
    1.84  # create archives