Admin/makedist
author huffman
Mon, 01 Mar 2010 16:36:25 -0800
changeset 35489 dd02201d95b6
parent 34037 6782e3a9169f
child 37217 b2769ba027b0
permissions -rwxr-xr-x
add function define_take_functions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
     1
#!/usr/bin/env bash
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
     2
#
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
     3
# makedist -- make Isabelle source distribution
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
     4
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
     5
## global settings
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
     6
33950
0a77b979e593 back to main repository;
wenzelm
parents: 33910
diff changeset
     7
REPOS_NAME="isabelle"
33909
24a9d433eb7f more abstract handling of repository name;
wenzelm
parents: 33899
diff changeset
     8
REPOS="http://isabelle.in.tum.de/repos/${REPOS_NAME}"
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
     9
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    10
DISTPREFIX=${DISTPREFIX:-~/tmp/isadist}
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    11
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    12
umask 022
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    13
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    14
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    15
## diagnostics
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    16
30885
a3cfe0e27deb misc tuning and updates;
wenzelm
parents: 30884
diff changeset
    17
PRG="$(basename "$0")"
a3cfe0e27deb misc tuning and updates;
wenzelm
parents: 30884
diff changeset
    18
THIS="$(cd $(dirname "$0"); echo "$PWD")"
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    19
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    20
function usage()
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    21
{
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    22
  cat <<EOF
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    23
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    24
Usage: $PRG [OPTIONS] [VERSION]
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    25
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    26
  Options are:
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    27
    -r RELEASE         proper release with name"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    28
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    29
  Make Isabelle distribution from the main Mercurial repository at TUM.
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    30
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    31
  VERSION identifies the snapshot, using usual Mercurial terminology;
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    32
  the default is RELEASE if given, otherwise "tip".
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    33
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    34
EOF
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    35
  exit 1
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    36
}
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    37
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    38
function fail()
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    39
{
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    40
  echo "$1" >&2
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    41
  exit 2
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    42
}
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    43
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    44
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    45
## process command line
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    46
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    47
# options
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    48
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    49
RELEASE=""
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    50
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    51
while getopts "r:" OPT
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    52
do
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    53
  case "$OPT" in
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    54
    r)
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    55
      RELEASE="$OPTARG"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    56
      ;;
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    57
    \?)
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    58
      usage
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    59
      ;;
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    60
  esac
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    61
done
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    62
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    63
shift $(($OPTIND - 1))
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    64
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    65
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    66
# args
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    67
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    68
VERSION=""
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    69
[ "$#" -gt 0 ] && { VERSION="$1"; shift; }
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    70
[ -z "$VERSION" ] && VERSION="$RELEASE"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    71
[ -z "$VERSION" ] && VERSION="tip"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    72
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    73
[ "$#" -gt 0 ] && usage
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    74
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    75
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    76
## main
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    77
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    78
# tmp
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    79
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    80
TMP="tmp-$USER$$"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    81
function purge_tmp () { rm -rf "$DISTPREFIX/$TMP"; }
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    82
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    83
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    84
# retrieve archive and resolve version identifier
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    85
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    86
mkdir "$DISTPREFIX/$TMP" || fail "Failed to create fresh directory"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    87
cd "$DISTPREFIX/$TMP"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    88
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    89
echo "###"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    90
echo "### Retrieving Mercurial repository $VERSION"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    91
echo "###"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    92
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    93
{ wget -q "$REPOS/archive/${VERSION}.tar.gz" -O- | tar -xzf -; } || \
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    94
  fail "Failed to retrieve $VERSION"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    95
33910
bae240a8bfe9 proper quotes;
wenzelm
parents: 33909
diff changeset
    96
IDENT=$(echo * | sed "s/${REPOS_NAME}-//")
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    97
33909
24a9d433eb7f more abstract handling of repository name;
wenzelm
parents: 33899
diff changeset
    98
rm -f "${REPOS_NAME}-${IDENT}/.hg_archival.txt"
24a9d433eb7f more abstract handling of repository name;
wenzelm
parents: 33899
diff changeset
    99
rm -f "${REPOS_NAME}-${IDENT}/.hgtags"
24a9d433eb7f more abstract handling of repository name;
wenzelm
parents: 33899
diff changeset
   100
rm -f "${REPOS_NAME}-${IDENT}/.hgignore"
24a9d433eb7f more abstract handling of repository name;
wenzelm
parents: 33899
diff changeset
   101
rm -f "${REPOS_NAME}-${IDENT}/README_REPOSITORY"
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   102
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   103
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   104
# dist name
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   105
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   106
DATE=$(env LC_ALL=C date "+%d-%b-%Y")
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   107
DISTDATE=$(env LC_ALL=C date "+%B %Y")
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   108
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   109
if [ -z "$RELEASE" ]; then
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   110
  DISTNAME="Isabelle_$DATE"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   111
  DISTVERSION="Isabelle repository snapshot $IDENT ($DATE)"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   112
else
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   113
  DISTNAME="$RELEASE"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   114
  DISTVERSION="$DISTNAME: $DISTDATE"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   115
fi
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   116
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   117
DISTBASE="$DISTPREFIX/dist-$DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   118
mkdir -p "$DISTBASE" || { purge_tmp; fail "Unable to create distribution base dir $DISTBASE!"; }
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   119
[ -e "$DISTBASE/$DISTNAME" ] && { purge_tmp; fail "$DISTBASE/$DISTNAME already exists!"; }
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   120
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   121
cd "$DISTBASE"
33909
24a9d433eb7f more abstract handling of repository name;
wenzelm
parents: 33899
diff changeset
   122
mv "$DISTPREFIX/$TMP/${REPOS_NAME}-${IDENT}" "$DISTNAME"
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   123
purge_tmp
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   124
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   125
cd "$DISTNAME" || fail "No dist directory: $DISTBASE/$DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   126
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   127
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   128
# prepare dist for release
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   129
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   130
echo "###"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   131
echo "### Preparing distribution $DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   132
echo "###"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   133
30885
a3cfe0e27deb misc tuning and updates;
wenzelm
parents: 30884
diff changeset
   134
rm -f .hgignore
30287
39b931e00ba9 silent chmod;
wenzelm
parents: 30140
diff changeset
   135
find . "(" -name \*.thy -o -name \*.ML ")" -perm +111 -print | xargs chmod -f -x
30885
a3cfe0e27deb misc tuning and updates;
wenzelm
parents: 30884
diff changeset
   136
find . -print | xargs chmod -f u+rw
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   137
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   138
./Admin/build all || fail "Failed to build distribution"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   139
rm -rf Admin
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   140
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   141
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')
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   142
mv -f $MOVE doc
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   143
rm doc/Isa-logics.eps
31842
af5221147455 discontinued separate "pdf" archive -- since it is now relatively small compared to the main archive, there is no point to fragment things;
wenzelm
parents: 30885
diff changeset
   144
rm doc/adaptation.dvi doc/adaptation.pdf doc/architecture.dvi doc/architecture.pdf
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   145
rm -rf doc-src
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   146
30140
wenzelm
parents: 30110
diff changeset
   147
mkdir -p contrib
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   148
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   149
cp doc/isabelle*.eps lib/logo
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   150
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   151
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   152
if [ -z "$RELEASE" ]; then
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   153
  {
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   154
    echo
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   155
    echo "IMPORTANT NOTE"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   156
    echo "=============="
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   157
    echo
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   158
    echo "This is an unofficial snapshot of Isabelle, created by $LOGNAME $DATE."
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   159
    echo "See $REPOS/log/$IDENT for details."
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   160
    echo
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   161
  } >ANNOUNCE
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   162
else
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   163
  perl -pi -e "s,val is_official = false,val is_official = true,g" src/Pure/ROOT.ML
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   164
fi
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   165
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   166
perl -pi -e "s,val changelog = \"\",val changelog = \"$REPOS/log/$IDENT\",g" src/Pure/ROOT.ML
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   167
perl -pi -e "s,ISABELLE_IDENTIFIER=\"\",ISABELLE_IDENTIFIER=\"$DISTNAME\",g" lib/scripts/getsettings
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   168
perl -pi -e "s,{ISABELLE},$DISTNAME,g" lib/html/library_index_header.template
32361
141e5151b918 clarified situation about unidentified repository versions -- in a distributed setting there is not "the" repository;
wenzelm
parents: 31842
diff changeset
   169
perl -pi -e "s,unidentified repository version,$DISTVERSION,g" src/Pure/ROOT.ML lib/Tools/version
141e5151b918 clarified situation about unidentified repository versions -- in a distributed setting there is not "the" repository;
wenzelm
parents: 31842
diff changeset
   170
perl -pi -e "s,some unidentified repository version of Isabelle,$DISTVERSION,g" README
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   171
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   172
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   173
# create archives
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   174
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   175
echo "###"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   176
echo "### Creating archives ..."
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   177
echo "###"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   178
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   179
cd "$DISTBASE"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   180
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   181
echo "$DISTBASE/$DISTNAME.tar.gz" > ../ISABELLE_DIST
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   182
echo "$IDENT" >../ISABELLE_IDENT
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   183
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   184
rm -f Isabelle
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   185
ln -s "$DISTNAME" Isabelle
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   186
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   187
chown -R "$LOGNAME" "$DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   188
chmod -R u+w "$DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   189
chmod -R g=o "$DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   190
chgrp -R isabelle "$DISTNAME" Isabelle
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   191
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   192
echo "$DISTNAME.tar.gz"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   193
tar -czf "$DISTNAME.tar.gz" Isabelle "$DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   194
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   195
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   196
# cleanup dist
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   197
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   198
mv "$DISTNAME" "${DISTNAME}-old"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   199
mkdir "$DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   200
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   201
mv "${DISTNAME}-old/README" "${DISTNAME}-old/INSTALL" "${DISTNAME}-old/NEWS" \
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   202
  "${DISTNAME}-old/ANNOUNCE" "${DISTNAME}-old/COPYRIGHT" "${DISTNAME}-old/CONTRIBUTORS" \
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   203
  "$DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   204
mkdir "$DISTNAME/doc"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   205
mv "${DISTNAME}-old/doc/"*.pdf "${DISTNAME}-old/doc/Contents" "$DISTNAME/doc"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   206
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   207
chgrp -R isabelle "$DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   208
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   209
rm -rf "${DISTNAME}-old"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   210