Admin/makedist_mercurial
author wenzelm
Sun, 30 Nov 2008 14:43:29 +0100
changeset 28917 20f43e0e0958
parent 28912 ddbadafef6bd
permissions -rwxr-xr-x
tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     1
#!/usr/bin/env bash
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     2
#
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     3
# $Id$
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     4
#
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     5
# makedist_mercurial -- make Isabelle source distribution (via Mercurial)
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     6
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     7
## global settings
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     8
27725
6d133c2b681f replaced mercurial.cgi by hgwebdir.cgi, resulting in http://isabelle.in.tum.de/repos/isabelle/
wenzelm
parents: 27654
diff changeset
     9
REPOS="http://isabelle.in.tum.de/repos/isabelle"
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    10
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    11
DISTPREFIX=${DISTPREFIX:-~/tmp/isadist}
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    12
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    13
umask 022
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    14
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    15
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    16
## diagnostics
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    17
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    18
PRG=$(basename "$0")
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    19
THIS=$(cd $(dirname "$0"); echo "$PWD")
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    20
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    21
function usage()
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    22
{
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    23
  cat <<EOF
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    24
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    25
Usage: $PRG [OPTIONS] [VERSION]
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    26
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    27
  Options are:
27654
0f8e2dcabbf9 misc tuning;
wenzelm
parents: 27648
diff changeset
    28
    -r RELEASE         proper release with name"
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    29
27654
0f8e2dcabbf9 misc tuning;
wenzelm
parents: 27648
diff changeset
    30
  Make Isabelle distribution from the main Mercurial repository at TUM.
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    31
27645
a1d7ee46387a proper usage message;
wenzelm
parents: 27644
diff changeset
    32
  VERSION identifies the snapshot, using usual Mercurial terminology;
27654
0f8e2dcabbf9 misc tuning;
wenzelm
parents: 27648
diff changeset
    33
  the default is RELEASE if given, otherwise "tip".
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    34
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    35
EOF
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    36
  exit 1
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    37
}
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    38
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    39
function fail()
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    40
{
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    41
  echo "$1" >&2
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    42
  exit 2
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    43
}
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    44
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    45
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    46
## process command line
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    47
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    48
# options
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    49
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    50
RELEASE=""
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    51
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    52
while getopts "r:" OPT
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    53
do
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    54
  case "$OPT" in
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    55
    r)
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    56
      RELEASE="$OPTARG"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    57
      ;;
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    58
    \?)
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    59
      usage
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    60
      ;;
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    61
  esac
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    62
done
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    63
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    64
shift $(($OPTIND - 1))
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    65
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    66
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    67
# args
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    68
27645
a1d7ee46387a proper usage message;
wenzelm
parents: 27644
diff changeset
    69
VERSION=""
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    70
[ "$#" -gt 0 ] && { VERSION="$1"; shift; }
27654
0f8e2dcabbf9 misc tuning;
wenzelm
parents: 27648
diff changeset
    71
[ -z "$VERSION" ] && VERSION="$RELEASE"
0f8e2dcabbf9 misc tuning;
wenzelm
parents: 27648
diff changeset
    72
[ -z "$VERSION" ] && VERSION="tip"
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    73
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    74
[ "$#" -gt 0 ] && usage
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    75
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    76
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    77
## main
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    78
27648
70973f73f09d proper purge_tmp;
wenzelm
parents: 27645
diff changeset
    79
# tmp
70973f73f09d proper purge_tmp;
wenzelm
parents: 27645
diff changeset
    80
70973f73f09d proper purge_tmp;
wenzelm
parents: 27645
diff changeset
    81
TMP="tmp-$USER$$"
70973f73f09d proper purge_tmp;
wenzelm
parents: 27645
diff changeset
    82
function purge_tmp () { rm -rf "$DISTPREFIX/$TMP"; }
70973f73f09d proper purge_tmp;
wenzelm
parents: 27645
diff changeset
    83
70973f73f09d proper purge_tmp;
wenzelm
parents: 27645
diff changeset
    84
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    85
# retrieve archive and resolve version identifier
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    86
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    87
mkdir "$DISTPREFIX/$TMP" || fail "Failed to create fresh directory"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    88
cd "$DISTPREFIX/$TMP"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    89
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    90
echo "###"
27654
0f8e2dcabbf9 misc tuning;
wenzelm
parents: 27648
diff changeset
    91
echo "### Retrieving Mercurial snapshot $VERSION"
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    92
echo "###"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    93
27654
0f8e2dcabbf9 misc tuning;
wenzelm
parents: 27648
diff changeset
    94
{ wget -q "$REPOS/archive/${VERSION}.tar.gz" -O- | tar -xzf -; } || \
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    95
  fail "Failed to retrieve $VERSION"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    96
28002
95bd956c476c renamed Isabelle-repository to isabelle;
wenzelm
parents: 27725
diff changeset
    97
IDENT=$(echo * | sed 's/isabelle-//')
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    98
28002
95bd956c476c renamed Isabelle-repository to isabelle;
wenzelm
parents: 27725
diff changeset
    99
rm -f "isabelle-$IDENT/.hg_archival.txt"
95bd956c476c renamed Isabelle-repository to isabelle;
wenzelm
parents: 27725
diff changeset
   100
rm -f "isabelle-$IDENT/.hgtags"
28912
ddbadafef6bd remove repository-only files;
wenzelm
parents: 28002
diff changeset
   101
rm -f "isabelle-$IDENT/.hgignore"
ddbadafef6bd remove repository-only files;
wenzelm
parents: 28002
diff changeset
   102
rm -f "isabelle-$IDENT/README_REPOSITORY"
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   103
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   104
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   105
# dist name
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   106
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   107
DATE=$(env LC_ALL=C date "+%d-%b-%Y")
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   108
DISTDATE=$(env LC_ALL=C date "+%B %Y")
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   109
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   110
if [ -z "$RELEASE" ]; then
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   111
  DISTNAME="Isabelle_$DATE"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   112
  DISTVERSION="Isabelle repository snapshot $IDENT ($DATE)"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   113
else
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   114
  DISTNAME="$RELEASE"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   115
  DISTVERSION="$DISTNAME: $DISTDATE"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   116
fi
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   117
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   118
DISTBASE="$DISTPREFIX/dist-$DISTNAME"
27648
70973f73f09d proper purge_tmp;
wenzelm
parents: 27645
diff changeset
   119
mkdir -p "$DISTBASE" || { purge_tmp; fail "Unable to create distribution base dir $DISTBASE!"; }
70973f73f09d proper purge_tmp;
wenzelm
parents: 27645
diff changeset
   120
[ -e "$DISTBASE/$DISTNAME" ] && { purge_tmp; fail "$DISTBASE/$DISTNAME already exists!"; }
70973f73f09d proper purge_tmp;
wenzelm
parents: 27645
diff changeset
   121
[ -e "$DISTBASE/pdf/$DISTNAME" ] && { purge_tmp; fail "$DISTBASE/pdf/$DISTNAME already exists!"; }
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   122
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   123
cd "$DISTBASE"
28002
95bd956c476c renamed Isabelle-repository to isabelle;
wenzelm
parents: 27725
diff changeset
   124
mv "$DISTPREFIX/$TMP/isabelle-$IDENT" "$DISTNAME"
27648
70973f73f09d proper purge_tmp;
wenzelm
parents: 27645
diff changeset
   125
purge_tmp
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   126
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   127
cd "$DISTNAME" || fail "No dist directory: $DISTBASE/$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   128
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   129
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   130
# website
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   131
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   132
mkdir -p ../website
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   133
cat > ../website/distinfo.mak <<EOF
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   134
# this is a generated file - do not edit unless you know what you are doing!
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   135
DISTNAME=$DISTNAME
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   136
DISTBASE=$DISTBASE
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   137
EOF
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   138
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   139
cp lib/html/library_index_content.template ../website/
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   140
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   141
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   142
# prepare dist for release
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   143
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   144
echo "###"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   145
echo "### Preparing distribution $DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   146
echo "###"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   147
27648
70973f73f09d proper purge_tmp;
wenzelm
parents: 27645
diff changeset
   148
find . -name .cvsignore -print | xargs rm -rf
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   149
find . "(" -name \*.thy -o -name \*.ML ")" -perm +111 -print | xargs chmod -x
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   150
find . -print | xargs chmod u+rw
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   151
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   152
./Admin/build all || fail "Failed to build distribution"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   153
rm -rf Admin
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   154
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   155
MOVE=$(find doc-src \( -type f -a -not -type l -a -not -name isabelle_isar.pdf -a -not -name pghead.pdf -a \( -name \*.dvi -o -name \*.eps -o -name \*.ps -o -name \*.pdf \) -a -print \) | grep -v 'gfx/.*pdf')
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   156
mv -f $MOVE doc
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   157
rm doc/Isa-logics.eps
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   158
rm doc/codegen_process.pdf
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   159
rm -rf doc-src
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   160
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   161
mkdir contrib
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   162
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   163
cp doc/isabelle*.eps lib/logo
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   164
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   165
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   166
if [ -z "$RELEASE" ]; then
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   167
  {
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   168
    echo
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   169
    echo "IMPORTANT NOTE"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   170
    echo "=============="
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   171
    echo
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   172
    echo "This is an unofficial snapshot of Isabelle, created by $LOGNAME $DATE."
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   173
    echo "See $REPOS/log/$IDENT for details."
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   174
    echo
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   175
  } >ANNOUNCE
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   176
else
27645
a1d7ee46387a proper usage message;
wenzelm
parents: 27644
diff changeset
   177
  perl -pi -e "s,val is_official = false,val is_official = true,g" src/Pure/ROOT.ML
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   178
fi
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   179
27645
a1d7ee46387a proper usage message;
wenzelm
parents: 27644
diff changeset
   180
perl -pi -e "s,val changelog = \"\",val changelog = \"$REPOS/log/$IDENT\",g" src/Pure/ROOT.ML
a1d7ee46387a proper usage message;
wenzelm
parents: 27644
diff changeset
   181
perl -pi -e "s,ISABELLE_IDENTIFIER=\"\",ISABELLE_IDENTIFIER=\"$DISTNAME\",g" lib/scripts/getsettings
a1d7ee46387a proper usage message;
wenzelm
parents: 27644
diff changeset
   182
perl -pi -e "s,{ISABELLE},$DISTNAME,g" lib/html/library_index_header.template
a1d7ee46387a proper usage message;
wenzelm
parents: 27644
diff changeset
   183
perl -pi -e "s,Isabelle repository version,$DISTVERSION,g" src/Pure/ROOT.ML lib/Tools/version
a1d7ee46387a proper usage message;
wenzelm
parents: 27644
diff changeset
   184
perl -pi -e "s,the internal repository version of Isabelle,$DISTVERSION,g" README
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   185
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   186
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   187
# create archives
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   188
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   189
echo "###"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   190
echo "### Creating archives ..."
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   191
echo "###"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   192
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   193
cd "$DISTBASE"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   194
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   195
echo "$DISTBASE/$DISTNAME.tar.gz" > ../ISABELLE_DIST
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   196
echo "$IDENT" >../ISABELLE_IDENT
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   197
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   198
rm -f Isabelle
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   199
ln -s "$DISTNAME" Isabelle
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   200
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   201
chown -R "$LOGNAME" "$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   202
chmod -R u+w "$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   203
chmod -R g=o "$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   204
chgrp -R isabelle "$DISTNAME" Isabelle
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   205
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   206
mkdir -p "pdf/$DISTNAME/doc"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   207
mv "$DISTNAME/doc/"*.pdf "pdf/$DISTNAME/doc"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   208
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   209
echo "$DISTNAME.tar.gz"
27654
0f8e2dcabbf9 misc tuning;
wenzelm
parents: 27648
diff changeset
   210
tar -czf "$DISTNAME.tar.gz" Isabelle "$DISTNAME"
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   211
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   212
echo "${DISTNAME}_pdf.tar.gz"
27654
0f8e2dcabbf9 misc tuning;
wenzelm
parents: 27648
diff changeset
   213
tar -C pdf -czf "${DISTNAME}_pdf.tar.gz" "$DISTNAME"
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   214
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   215
mv "pdf/$DISTNAME/doc/"*.pdf "$DISTNAME/doc"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   216
rmdir "pdf/$DISTNAME/doc" "pdf/$DISTNAME" pdf
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   217
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   218
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   219
# cleanup dist
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   220
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   221
mv "$DISTNAME" "${DISTNAME}-old"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   222
mkdir "$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   223
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   224
mv "${DISTNAME}-old/README" "${DISTNAME}-old/INSTALL" "${DISTNAME}-old/NEWS" \
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   225
  "${DISTNAME}-old/ANNOUNCE" "${DISTNAME}-old/COPYRIGHT" "${DISTNAME}-old/CONTRIBUTORS" \
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   226
  "$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   227
mkdir "$DISTNAME/doc"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   228
mv "${DISTNAME}-old/doc/"*.pdf "${DISTNAME}-old/doc/Contents" "$DISTNAME/doc"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   229
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   230
chgrp -R isabelle "$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   231
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   232
rm -rf "${DISTNAME}-old"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   233