]> git.pld-linux.org Git - packages/mysql.git/blob - percona.sh
- rel 3; pld cmake macro sets build type to PLD which causes mysql to be built with...
[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         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 pull
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         # if patch already existed, use mysql- prefix
34         if [ -f mysql-$patch ]; then
35                 file=mysql-$patch
36         else
37                 file=$patch
38         fi
39         cat $version/$patch | filter_files > $file
40
41         if [ -z "$(awk -vfile=$file -F/ '$2 == file{print}' CVS/Entries)" ]; then
42                 cvs add $file
43                 ${branch:+cvs up -r $branch $file}
44         fi
45
46         if [ "$patch" != "$file" ]; then
47                 echo >&2 "Adding: $file ($patch)"
48         else
49                 echo >&2 "Adding: $file"
50         fi
51         printf "Patch%d:\t%s\n" $i $(echo "$file" | sed -e 's,^mysql-,%{name}-,') >> .percona.spec
52         printf "%%patch%d -p1\n" $i >> .patch.spec
53         i=$((i+1))
54 done
55
56 # update PatchX section
57 sed -i -e '
58 /^# <percona patches/,/^# <\/percona>/ {
59         /^ <\/percona>/b
60         /^# <percona patches/ {
61                 p # print header
62                 r .percona.spec
63                 a# </percona>
64         }
65         d
66 }
67 ' mysql.spec
68
69 # update %patchX section
70 sed -i -e '
71 /^# <percona %patches/,/^# <\/percona>/ {
72         /^ <\/percona>/b
73         /^# <percona %patches/ {
74                 p # print header
75                 r .patch.spec
76                 a# </percona>
77         }
78         d
79 }
80 ' mysql.spec
This page took 0.02625 seconds and 3 git commands to generate.