-
Notifications
You must be signed in to change notification settings - Fork 28
/
hackage.sh
77 lines (66 loc) · 1.05 KB
/
hackage.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
#!/bin/sh
# Lee Pike
# (c) Galois, Inc.
#
# Package and upload packages to Hackage with new version numbers.
#
# Usage:
# In ivory/
# USER=XXX PASS=YYY sh hackage.sh
set -e
DIRS="ivory \
ivory-artifact
ivory-backend-c \
ivory-eval \
ivory-examples \
ivory-hw \
ivory-opts \
ivory-serialize \
ivory-stdlib \
ivory-quickcheck"
# Print current package versions
show_versions() {
for i in $DIRS
do
cd $i
echo "package: " $i
awk '/^version:/ {print $1 "\t" $2}' $i.cabal
cd ..
done
}
OLD_VERSION=0.1.0.4
NEW_VERSION=0.1.0.5
change_versions() {
for i in $DIRS
do
cd $i
echo "package: " $i
sed -i.tmp -e "s/^\(version:[ ]*\)\($OLD_VERSION\)/\1$NEW_VERSION/" $i.cabal
rm $i.cabal.tmp
cd ..
done
}
package() {
for i in $DIRS
do
cd $i
echo "package: " $i
cabal sdist
cabal check
cd ..
done
}
upload() {
for i in $DIRS
do
cd $i
echo "package: " $i
cabal upload -u $USER -p $PASS dist/$i-$NEW_VERSION.tar.gz
cd ..
done
}
show_versions;
change_versions;
show_versions;
package;
upload;