]> git.pld-linux.org Git - packages/mysql.git/blob - percona.sh
- 5.0.87-b20
[packages/mysql.git] / percona.sh
1 #!/bin/sh
2 # updates percona patches
3 # http://www.percona.com/docs/wiki/release:start
4
5 ver=5.0.87-b20
6 patches=http://www.percona.com/mysql/$ver/patches
7 series=$patches/series
8 branch=MYSQL_5_0
9
10 filter_names() {
11         grep -v 'mysqld_safe_syslog.patch'
12 }
13
14 filter_files() {
15         filterdiff -x '*/configure'
16 }
17
18 > .percona.spec
19 > .patch.spec
20 i=100
21 for patch in $(wget -q -O - $series | filter_names); do
22         file=mysql-$patch
23         wget -nv $patches/$patch -O - | filter_files > $file
24
25         if [ -z "$(awk -vfile=$file -F/ '$2 == file{print}' CVS/Entries)" ]; then
26                 cvs add $file
27                 ${branch:+cvs up -r $branch $file}
28         fi
29
30         printf "Patch%d:\t%s\n" $i %{name}-$patch >> .percona.spec
31         printf "%%patch%d -p1\n" $i >> .patch.spec
32         i=$((i+1))
33 done
34
35 # update PatchX section
36 sed -i -e '
37 /^# <percona patches/,/^# <\/percona>/ {
38         /^ <\/percona>/b
39         /^# <percona patches/ {
40                 p # print header
41                 r .percona.spec
42                 a# </percona>
43         }
44         d
45 }
46 ' mysql.spec
47
48 # update %patchX section
49 sed -i -e '
50 /^# <percona %patches/,/^# <\/percona>/ {
51         /^ <\/percona>/b
52         /^# <percona %patches/ {
53                 p # print header
54                 r .patch.spec
55                 a# </percona>
56         }
57         d
58 }
59 ' mysql.spec
This page took 0.072453 seconds and 4 git commands to generate.