-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrelease.sh
96 lines (72 loc) · 2.34 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
set -e
test "$1" = "--dry" && {
dry=1
shift
}
really=1
die() {
test -z "$really" && echo -n "W: "
echo -e "$@" 1>&2
test -n "$really" && exit 1 || true
}
test -f divine/version.cpp || die "Doesn't look like a divine source tree to me..."
if test -n "$1"; then
name="$1"
else
version_=$(grep "^#define DIVINE_VERSION" divine/version.cpp)
version=$(echo $version_ | sed -e 's,#define DIVINE_VERSION "\([^"]*\)",\1,')
name="divine-$version"
fi
test -e "$name" && die "$name already exists!"
test -e "$name.tar.gz" && die "$name.tar.gz already exists!"
## CHECK ###############
test -n "$dry" && really=
echo checking repository state...
test -d _darcs || die "Doesn't look like a darcs repository..."
darcs wh >& /dev/null && \
die "Seems like you have local changes. Please don't."
if darcs chan --from-tag $version > /dev/null 2>&1; then
test "`darcs chan --from-tag $version --count 2> /dev/null`" = 1 || {
darcs chan --from-tag $version
die "You have patches after current release ($version) tag.\n" \
"Sounds like a bad idea to me. Maybe try with -i?"
}
else
die "There doesn't seem to be a release ($version) tag."
fi
head -n1 NEWS | grep -q "DiVinE $version" || \
die "Seems that first entry in NEWS is not for $version..."
## BUILD ###############
echo populating the tarball...
for f in `darcs query manifest`; do
mkdir -p "$name/`dirname $f`"
cp "$f" "$name/$f"
done
echo updating autogenerated bits in the tarball...
darcs query manifest > "$name/manifest"
markdown $name/README > $name/README.html
chmod +x "$name/configure"
echo creating $name.tar.gz...
tar czf "$name.tar.gz" "$name"
rm -rf "$name"
## VALIDATE ###############
echo validating...
tar xzf "$name.tar.gz"
cd $name
./configure
make
make check
echo version: `./_build/tools/divine --version`
./_build/tools/divine --version | grep "^DiVinE version $version$" # no hashes in there
cd ..
rm -rf $name
test -z "$really" && {
echo looks good, but not uploading -- you specified --dry
exit 0
}
echo uploading and updating NEWS...
scp $name.tar.gz anna.fi.muni.cz:/srv/www/divine-pages/
scp NEWS anna.fi.muni.cz:/srv/www/divine-pages/WHATS_NEW
ssh anna.fi.muni.cz chmod 644 /srv/www/divine-pages/{$name.tar.gz,WHATS_NEW}
echo "now it's up to you... announce, add download links, open champagne"