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