]> git.pld-linux.org Git - packages/mysql.git/blob - percona.sh
- updated to 5.5.32
[packages/mysql.git] / percona.sh
1 #!/bin/sh
2 # updates percona patches
3 # http://www.percona.com/docs/wiki/repositories:start
4 # http://bazaar.launchpad.net/~percona-dev/percona-server/5.5.8/files
5 # https://launchpad.net/percona-server/5.5
6 # bzr branch lp:percona-server/5.5
7
8 version=5.5
9 bzr_branch=lp:percona-server/$version
10 #version=5.5.9
11 #bzr_branch=lp:percona-dev/percona-server/$version
12 branch=
13
14 filter_names() {
15         grep -v 'percona-support.patch' | \
16         grep -v 'mysqld_safe_syslog.patch' | \
17         grep -v 'mysql-test.diff'
18 }
19
20 filter_files() {
21         filterdiff -x '*/configure'
22 }
23
24 set -e
25
26 if [ -d $version ]; then
27         cd $version
28         bzr pull
29         cd ..
30 else
31         bzr branch $bzr_branch $version
32 fi
33
34 > .percona.spec
35 > .patch.spec
36 i=100
37 [ -d "$version/patches" ] && dir=$version/patches || dir=$version
38 for patch in $(cat $dir/series | filter_names); do
39         # if patch already existed, use mysql- prefix
40         if [ -f mysql-$patch ]; then
41                 file=mysql-$patch
42         else
43                 file=$patch
44         fi
45         cat $dir/$patch | filter_files > $file
46
47         if [ -z "$(awk -vfile=$file -F/ '$2 == file{print}' CVS/Entries)" ]; then
48                 cvs add $file
49                 ${branch:+cvs up -r $branch $file}
50         fi
51
52         if [ "$patch" != "$file" ]; then
53                 echo >&2 "Adding: $file ($patch)"
54         else
55                 echo >&2 "Adding: $file"
56         fi
57         printf "Patch%d:\t%s\n" $i $(echo "$file" | sed -e 's,^mysql-,%{name}-,') >> .percona.spec
58         printf "%%patch%d -p1\n" $i >> .patch.spec
59         i=$((i+1))
60 done
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 .percona.spec
69                 a# </percona>
70         }
71         d
72 }
73 ' mysql.spec
74
75 # update %patchX section
76 sed -i -e '
77 /^# <percona %patches/,/^# <\/percona>/ {
78         /^ <\/percona>/b
79         /^# <percona %patches/ {
80                 p # print header
81                 r .patch.spec
82                 a# </percona>
83         }
84         d
85 }
86 ' mysql.spec
This page took 0.028496 seconds and 3 git commands to generate.