-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·100 lines (76 loc) · 2.17 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
97
98
99
100
#!/bin/bash -x
set -e
vers=`grep AM_INIT_AUTOMAKE configure.ac | head -1 | cut '-d ' -f 2 | sed 's/)//'`
echo vers $vers
repo=$1
debsubver=$2
force=$3
[ -z "$debsubver" ] && debsubver=1
[ -z "$repo" ] && echo stable or testing or unstable or rc && exit 1
if git diff --quiet ; then
echo repository is clean
else
echo
echo "**** REPOSITORY IS DIRTY ****"
echo
if [ "$force" != "force" ]; then
echo "add 'force' argument if you really want to continue."
exit 1
fi
echo "forcing."
fi
gitver=`git rev-parse HEAD 2>/dev/null | cut -c 1-8`
echo gitver $gitver
if [ "$repo" = "stable" ]; then
cephver="$vers"
else
versuffix=`date "+%Y%m%d%H%M"`
cephver="${vers}-$repo${versuffix}-$gitver"
fi
echo final vers $cephver
if [ -d "release/$cephver" ]; then
echo "release/$cephver already exists; reusing that release tarball"
cd release/$cephver
tar zxvf ceph_$cephver.orig.tar.gz
else
echo making sure .git_version is up to date
cd src
./check_version .git_version
cd ..
echo building tarball
make dist
echo extracting
mkdir -p release/$cephver
cd release/$cephver
tar zxf ../../ceph-$vers.tar.gz
[ "$vers" != "$cephver" ] && mv ceph-$vers ceph-$cephver
tar zcf ceph_$cephver.orig.tar.gz ceph-$cephver
cp -a ceph_$cephver.orig.tar.gz ceph-$cephver.tar.gz
fi
# add debian dir
echo "copying latest debian dir"
cp -a ../../debian ceph-$cephver
debver="$cephver-$debsubver"
for dist in sid squeeze lenny maverick lucid
do
echo building $dist dsc
# mkdir $dist
# cd $dist
bpver=`../../debvers.sh $debver $dist`
comment=""
# [ "$debsubver" != "1" ] && comment="package fixes "
[ -n "$versuffix" ] && comment="git snapshot "
[ "$dist" != "sid" ] && comment="${comment}$dist backport"
if [ -n "$comment" ]; then
cd ceph-$cephver
DEBEMAIL="[email protected]" dch -D $dist --force-distribution -b -v "$bpver" "$comment"
cd ..
fi
[ "$dist" = "lenny" ] && sed -i 's/, libgoogle-perftools-dev//' ceph-$cephver/debian/control
dpkg-source -b ceph-$cephver
# cd ..
done
rm -r ceph-$cephver
echo finished release $debver
cd ../..
echo $cephver > .last_release