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