Admin/makedist_mercurial
changeset 27654 0f8e2dcabbf9
parent 27648 70973f73f09d
child 27725 6d133c2b681f
equal deleted inserted replaced
27653:180e28bab764 27654:0f8e2dcabbf9
    23   cat <<EOF
    23   cat <<EOF
    24 
    24 
    25 Usage: $PRG [OPTIONS] [VERSION]
    25 Usage: $PRG [OPTIONS] [VERSION]
    26 
    26 
    27   Options are:
    27   Options are:
    28     -r NAME         proper release with name"
    28     -r RELEASE         proper release with name"
    29 
    29 
    30   Make Isabelle distribution from the Mercurial repository at TUM.
    30   Make Isabelle distribution from the main Mercurial repository at TUM.
    31 
    31 
    32   VERSION identifies the snapshot, using usual Mercurial terminology;
    32   VERSION identifies the snapshot, using usual Mercurial terminology;
    33   the default is "tip", or the proper release name if given.
    33   the default is RELEASE if given, otherwise "tip".
    34 
    34 
    35 EOF
    35 EOF
    36   exit 1
    36   exit 1
    37 }
    37 }
    38 
    38 
    66 
    66 
    67 # args
    67 # args
    68 
    68 
    69 VERSION=""
    69 VERSION=""
    70 [ "$#" -gt 0 ] && { VERSION="$1"; shift; }
    70 [ "$#" -gt 0 ] && { VERSION="$1"; shift; }
       
    71 [ -z "$VERSION" ] && VERSION="$RELEASE"
       
    72 [ -z "$VERSION" ] && VERSION="tip"
    71 
    73 
    72 [ "$#" -gt 0 ] && usage
    74 [ "$#" -gt 0 ] && usage
    73 
       
    74 
       
    75 # defaults
       
    76 
       
    77 if [ -z "$RELEASE" ]; then
       
    78   [ -z "$VERSION" ] && VERSION=tip
       
    79 else
       
    80   [ -z "$VERSION" ] && VERSION="$RELEASE"
       
    81 fi
       
    82 
    75 
    83 
    76 
    84 ## main
    77 ## main
    85 
    78 
    86 # tmp
    79 # tmp
    93 
    86 
    94 mkdir "$DISTPREFIX/$TMP" || fail "Failed to create fresh directory"
    87 mkdir "$DISTPREFIX/$TMP" || fail "Failed to create fresh directory"
    95 cd "$DISTPREFIX/$TMP"
    88 cd "$DISTPREFIX/$TMP"
    96 
    89 
    97 echo "###"
    90 echo "###"
    98 echo "### Retrieving Mercurial snapshot ${VERSION}.tar.gz"
    91 echo "### Retrieving Mercurial snapshot $VERSION"
    99 echo "###"
    92 echo "###"
   100 
    93 
   101 { wget -q "$REPOS/archive/${VERSION}.tar.gz" && tar -x -z -f "${VERSION}.tar.gz"; } || \
    94 { wget -q "$REPOS/archive/${VERSION}.tar.gz" -O- | tar -xzf -; } || \
   102   fail "Failed to retrieve $VERSION"
    95   fail "Failed to retrieve $VERSION"
   103 
    96 
   104 rm "${VERSION}.tar.gz"
       
   105 IDENT=$(echo * | sed 's/Isabelle-repository-//')
    97 IDENT=$(echo * | sed 's/Isabelle-repository-//')
   106 
    98 
   107 rm -f "Isabelle-repository-$IDENT/.hg_archival.txt"
    99 rm -f "Isabelle-repository-$IDENT/.hg_archival.txt"
   108 rm -f "Isabelle-repository-$IDENT/.hgtags"
   100 rm -f "Isabelle-repository-$IDENT/.hgtags"
   109 
   101 
   136 # website
   128 # website
   137 
   129 
   138 mkdir -p ../website
   130 mkdir -p ../website
   139 cat > ../website/distinfo.mak <<EOF
   131 cat > ../website/distinfo.mak <<EOF
   140 # this is a generated file - do not edit unless you know what you are doing!
   132 # this is a generated file - do not edit unless you know what you are doing!
   141 
       
   142 DISTNAME=$DISTNAME
   133 DISTNAME=$DISTNAME
   143 DISTBASE=$DISTBASE
   134 DISTBASE=$DISTBASE
   144 EOF
   135 EOF
   145 
   136 
   146 cp lib/html/library_index_content.template ../website/
   137 cp lib/html/library_index_content.template ../website/
   212 
   203 
   213 mkdir -p "pdf/$DISTNAME/doc"
   204 mkdir -p "pdf/$DISTNAME/doc"
   214 mv "$DISTNAME/doc/"*.pdf "pdf/$DISTNAME/doc"
   205 mv "$DISTNAME/doc/"*.pdf "pdf/$DISTNAME/doc"
   215 
   206 
   216 echo "$DISTNAME.tar.gz"
   207 echo "$DISTNAME.tar.gz"
   217 tar -c -z -f "$DISTNAME.tar.gz" Isabelle "$DISTNAME"
   208 tar -czf "$DISTNAME.tar.gz" Isabelle "$DISTNAME"
   218 
   209 
   219 echo "${DISTNAME}_pdf.tar.gz"
   210 echo "${DISTNAME}_pdf.tar.gz"
   220 tar -C pdf -c -z -f "${DISTNAME}_pdf.tar.gz" "$DISTNAME"
   211 tar -C pdf -czf "${DISTNAME}_pdf.tar.gz" "$DISTNAME"
   221 
   212 
   222 mv "pdf/$DISTNAME/doc/"*.pdf "$DISTNAME/doc"
   213 mv "pdf/$DISTNAME/doc/"*.pdf "$DISTNAME/doc"
   223 rmdir "pdf/$DISTNAME/doc" "pdf/$DISTNAME" pdf
   214 rmdir "pdf/$DISTNAME/doc" "pdf/$DISTNAME" pdf
   224 
   215 
   225 
   216 
   236 
   227 
   237 chgrp -R isabelle "$DISTNAME"
   228 chgrp -R isabelle "$DISTNAME"
   238 
   229 
   239 rm -rf "${DISTNAME}-old"
   230 rm -rf "${DISTNAME}-old"
   240 
   231 
   241 echo "###"
       
   242 echo "### Finished makedist."
       
   243 echo "###"