author | huffman |
Tue, 13 Jan 2009 14:08:24 -0800 | |
changeset 29479 | be8a15ffc511 |
parent 28942 | 043a42ba2a4d |
child 29637 | da018485b89d |
permissions | -rwxr-xr-x |
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 |
# $Id$ |
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 |
# makedist -- make Isabelle source distribution |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
6 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
7 |
## global settings |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
8 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
9 |
REPOS="http://isabelle.in.tum.de/repos/isabelle" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
10 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
11 |
DISTPREFIX=${DISTPREFIX:-~/tmp/isadist} |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
12 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
13 |
umask 022 |
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 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
16 |
## diagnostics |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
17 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
18 |
PRG=$(basename "$0") |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
19 |
THIS=$(cd $(dirname "$0"); echo "$PWD") |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
20 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
21 |
function usage() |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
22 |
{ |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
23 |
cat <<EOF |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
24 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
25 |
Usage: $PRG [OPTIONS] [VERSION] |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
26 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
27 |
Options are: |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
28 |
-r RELEASE proper release with name" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
29 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
30 |
Make Isabelle distribution from the main Mercurial repository at TUM. |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
31 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
32 |
VERSION identifies the snapshot, using usual Mercurial terminology; |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
33 |
the default is RELEASE if given, otherwise "tip". |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
34 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
35 |
EOF |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
36 |
exit 1 |
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 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
39 |
function fail() |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
40 |
{ |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
41 |
echo "$1" >&2 |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
42 |
exit 2 |
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 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
46 |
## process command line |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
47 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
48 |
# options |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
49 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
50 |
RELEASE="" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
51 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
52 |
while getopts "r:" OPT |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
53 |
do |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
54 |
case "$OPT" in |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
55 |
r) |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
56 |
RELEASE="$OPTARG" |
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 |
\?) |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
59 |
usage |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
60 |
;; |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
61 |
esac |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
62 |
done |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
63 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
64 |
shift $(($OPTIND - 1)) |
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 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
67 |
# args |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
68 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
69 |
VERSION="" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
70 |
[ "$#" -gt 0 ] && { VERSION="$1"; shift; } |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
71 |
[ -z "$VERSION" ] && VERSION="$RELEASE" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
72 |
[ -z "$VERSION" ] && VERSION="tip" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
73 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
74 |
[ "$#" -gt 0 ] && usage |
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 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
77 |
## main |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
78 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
79 |
# tmp |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
80 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
81 |
TMP="tmp-$USER$$" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
82 |
function purge_tmp () { rm -rf "$DISTPREFIX/$TMP"; } |
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 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
85 |
# retrieve archive and resolve version identifier |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
86 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
87 |
mkdir "$DISTPREFIX/$TMP" || fail "Failed to create fresh directory" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
88 |
cd "$DISTPREFIX/$TMP" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
89 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
90 |
echo "###" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
91 |
echo "### Retrieving Mercurial repository $VERSION" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
92 |
echo "###" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
93 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
94 |
{ wget -q "$REPOS/archive/${VERSION}.tar.gz" -O- | tar -xzf -; } || \ |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
95 |
fail "Failed to retrieve $VERSION" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
96 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
97 |
IDENT=$(echo * | sed 's/isabelle-//') |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
98 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
99 |
rm -f "isabelle-$IDENT/.hg_archival.txt" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
100 |
rm -f "isabelle-$IDENT/.hgtags" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
101 |
rm -f "isabelle-$IDENT/.hgignore" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
102 |
rm -f "isabelle-$IDENT/README_REPOSITORY" |
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 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
105 |
# dist name |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
106 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
107 |
DATE=$(env LC_ALL=C date "+%d-%b-%Y") |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
108 |
DISTDATE=$(env LC_ALL=C date "+%B %Y") |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
109 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
110 |
if [ -z "$RELEASE" ]; then |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
111 |
DISTNAME="Isabelle_$DATE" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
112 |
DISTVERSION="Isabelle repository snapshot $IDENT ($DATE)" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
113 |
else |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
114 |
DISTNAME="$RELEASE" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
115 |
DISTVERSION="$DISTNAME: $DISTDATE" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
116 |
fi |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
117 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
118 |
DISTBASE="$DISTPREFIX/dist-$DISTNAME" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
119 |
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
|
120 |
[ -e "$DISTBASE/$DISTNAME" ] && { purge_tmp; fail "$DISTBASE/$DISTNAME already exists!"; } |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
121 |
[ -e "$DISTBASE/pdf/$DISTNAME" ] && { purge_tmp; fail "$DISTBASE/pdf/$DISTNAME already exists!"; } |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
122 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
123 |
cd "$DISTBASE" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
124 |
mv "$DISTPREFIX/$TMP/isabelle-$IDENT" "$DISTNAME" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
125 |
purge_tmp |
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 |
cd "$DISTNAME" || fail "No dist directory: $DISTBASE/$DISTNAME" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
128 |
|
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 |
# website |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
131 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
132 |
mkdir -p ../website |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
133 |
cat > ../website/distinfo.mak <<EOF |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
134 |
# this is a generated file - do not edit unless you know what you are doing! |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
135 |
DISTNAME=$DISTNAME |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
136 |
DISTBASE=$DISTBASE |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
137 |
EOF |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
138 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
139 |
cp lib/html/library_index_content.template ../website/ |
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 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
142 |
# prepare dist for release |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
143 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
144 |
echo "###" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
145 |
echo "### Preparing distribution $DISTNAME" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
146 |
echo "###" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
147 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
148 |
find . -name .cvsignore -print | xargs rm -rf |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
149 |
find . "(" -name \*.thy -o -name \*.ML ")" -perm +111 -print | xargs chmod -x |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
150 |
find . -print | xargs chmod u+rw |
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 |
./Admin/build all || fail "Failed to build distribution" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
153 |
rm -rf Admin |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
154 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
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') |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
156 |
mv -f $MOVE doc |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
157 |
rm doc/Isa-logics.eps |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
158 |
rm doc/codegen_process.pdf |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
159 |
rm -rf doc-src |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
160 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
161 |
mkdir contrib |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
162 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
163 |
cp doc/isabelle*.eps lib/logo |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
164 |
|
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 |
if [ -z "$RELEASE" ]; then |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
167 |
{ |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
168 |
echo |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
169 |
echo "IMPORTANT NOTE" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
170 |
echo "==============" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
171 |
echo |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
172 |
echo "This is an unofficial snapshot of Isabelle, created by $LOGNAME $DATE." |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
173 |
echo "See $REPOS/log/$IDENT for details." |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
174 |
echo |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
175 |
} >ANNOUNCE |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
176 |
else |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
177 |
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
|
178 |
fi |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
179 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
180 |
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
|
181 |
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
|
182 |
perl -pi -e "s,{ISABELLE},$DISTNAME,g" lib/html/library_index_header.template |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
183 |
perl -pi -e "s,Isabelle repository version,$DISTVERSION,g" src/Pure/ROOT.ML lib/Tools/version |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
184 |
perl -pi -e "s,the internal repository version of Isabelle,$DISTVERSION,g" README |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
185 |
|
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 |
# create archives |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
188 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
189 |
echo "###" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
190 |
echo "### Creating archives ..." |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
191 |
echo "###" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
192 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
193 |
cd "$DISTBASE" |
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 |
echo "$DISTBASE/$DISTNAME.tar.gz" > ../ISABELLE_DIST |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
196 |
echo "$IDENT" >../ISABELLE_IDENT |
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 |
rm -f Isabelle |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
199 |
ln -s "$DISTNAME" Isabelle |
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 |
chown -R "$LOGNAME" "$DISTNAME" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
202 |
chmod -R u+w "$DISTNAME" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
203 |
chmod -R g=o "$DISTNAME" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
204 |
chgrp -R isabelle "$DISTNAME" Isabelle |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
205 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
206 |
mkdir -p "pdf/$DISTNAME/doc" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
207 |
mv "$DISTNAME/doc/"*.pdf "pdf/$DISTNAME/doc" |
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 |
echo "$DISTNAME.tar.gz" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
210 |
tar -czf "$DISTNAME.tar.gz" Isabelle "$DISTNAME" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
211 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
212 |
echo "${DISTNAME}_pdf.tar.gz" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
213 |
tar -C pdf -czf "${DISTNAME}_pdf.tar.gz" "$DISTNAME" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
214 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
215 |
mv "pdf/$DISTNAME/doc/"*.pdf "$DISTNAME/doc" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
216 |
rmdir "pdf/$DISTNAME/doc" "pdf/$DISTNAME" pdf |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
217 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
218 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
219 |
# cleanup dist |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
220 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
221 |
mv "$DISTNAME" "${DISTNAME}-old" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
222 |
mkdir "$DISTNAME" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
223 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
224 |
mv "${DISTNAME}-old/README" "${DISTNAME}-old/INSTALL" "${DISTNAME}-old/NEWS" \ |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
225 |
"${DISTNAME}-old/ANNOUNCE" "${DISTNAME}-old/COPYRIGHT" "${DISTNAME}-old/CONTRIBUTORS" \ |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
226 |
"$DISTNAME" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
227 |
mkdir "$DISTNAME/doc" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
228 |
mv "${DISTNAME}-old/doc/"*.pdf "${DISTNAME}-old/doc/Contents" "$DISTNAME/doc" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
229 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
230 |
chgrp -R isabelle "$DISTNAME" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
231 |
|
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
232 |
rm -rf "${DISTNAME}-old" |
ccaa3355f7d3
makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff
changeset
|
233 |