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