Merge lp:~tsarev/percona-server/quilt-5.5-1 into lp:~stewart/percona-server/quilt-5.5

Proposed by Oleg Tsarev
Status: Merged
Approved by: Stewart Smith
Approved revision: no longer in the source branch.
Merge reported by: Stewart Smith
Merged at revision: not available
Proposed branch: lp:~tsarev/percona-server/quilt-5.5-1
Merge into: lp:~stewart/percona-server/quilt-5.5
Diff against target: 195 lines (+24/-104)
6 files modified
Makefile (+10/-4)
apply_patches (+2/-2)
install_tests (+1/-1)
normalize_patches (+5/-50)
quiltrc (+6/-1)
regenerate_patch.sh (+0/-46)
To merge this branch: bzr merge lp:~tsarev/percona-server/quilt-5.5-1
Reviewer Review Type Date Requested Status
Stewart Smith Approve
Laurynas Biveinis (community) Approve
Stewart Smith Pending
Review via email: mp+69432@code.launchpad.net

Commit message

1. Makefile:
  * add symlink to quiltrc to $(PERCONA_SERVER) dir
  * split "main" target to "prepare" and "main" (prepare just unpack source code and setup for patch appling, main also apply patches)
  * add target "regenerate" (old normalize_patches.sh) (requires for future porting to new mysql version)
  * fix "clean" target
2. apply_patches:
  * fix usages: "--quiltrc=quiltrc"
  * now uses sh instead of bash
3. install_tests:
  * rename to install_tests from install_tests.sh
  * fix path to series
4. normalize_patches:
  * rename to normalize_patches from normalize_patches.sh
  * now use quilt for regenerate patches
5. quiltrc:
  * add QUILT_[REFRESH|DIFF|PATCH]_[ARGS|OPTS] options
6. regenerate_patch.sh:
  * removed (unecessary now)

Description of the change

1. Makefile:
  * add symlink to quiltrc to $(PERCONA_SERVER) dir
  * split "main" target to "prepare" and "main" (prepare just unpack source code and setup for patch appling, main also apply patches)
  * add target "regenerate" (old normalize_patches.sh) (requires for future porting to new mysql version)
  * fix "clean" target
2. apply_patches:
  * fix usages: "--quiltrc=quiltrc"
  * now uses sh instead of bash
3. install_tests:
  * rename to install_tests from install_tests.sh
  * fix path to series
4. normalize_patches:
  * rename to normalize_patches from normalize_patches.sh
  * now use quilt for regenerate patches
5. quiltrc:
  * add QUILT_[REFRESH|DIFF|PATCH]_[ARGS|OPTS] options
6. regenerate_patch.sh:
  * removed (unecessary now)

To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

LGTM. As for 5.1 I think we should clean up Makefiles wrt phony targets, but not for this patch.

(For the future, I think this MP should have been made for trunk, specifying Stewart's lp:~stewart/percona-server/quilt-5.1 as the prerequisite branch.)

review: Approve
Revision history for this message
Stewart Smith (stewart) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2011-07-25 14:56:50 +0000
3+++ Makefile 2011-07-27 11:16:15 +0000
4@@ -68,7 +68,7 @@
5 @echo "Installing license files"
6 install -m 644 COPYING.* $(PERCONA_SERVER)
7
8-main: mysql-$(MYSQL_VERSION).tar.gz
9+prepare: mysql-$(MYSQL_VERSION).tar.gz
10 @echo "Prepare Percona Server sources"
11 rm -rf mysql-$(MYSQL_VERSION)
12 rm -rf $(PERCONA_SERVER);
13@@ -79,19 +79,25 @@
14 ln -s $(PERCONA_SERVER) $(PERCONA_SERVER_SHORT_1)
15 ln -s $(PERCONA_SERVER) $(PERCONA_SERVER_SHORT_2)
16 ln -s ../patches $(PERCONA_SERVER)/patches
17+ rm $(PERCONA_SERVER)/sql/sql_yacc.cc $(PERCONA_SERVER)/sql/sql_yacc.h
18+ ln -s ../quiltrc $(PERCONA_SERVER)/quiltrc
19+
20+main: prepare
21 (cd $(PERCONA_SERVER) && ../apply_patches)
22- rm $(PERCONA_SERVER)/sql/sql_yacc.cc $(PERCONA_SERVER)/sql/sql_yacc.h
23+
24+regenerate: clean prepare
25+ (cd $(PERCONA_SERVER) && ../normalize_patches)
26
27 mysql-$(MYSQL_VERSION).tar.gz:
28 @echo "Downloading MySQL sources from $(MASTER_SITE)"
29 $(FETCH_CMD) $(MASTER_SITE)/mysql-$(MYSQL_VERSION).tar.gz
30
31 tests:
32- PERCONA_SERVER=${PERCONA_SERVER} sh install_tests.sh
33+ PERCONA_SERVER=${PERCONA_SERVER} sh install_tests
34
35 misc:
36 @echo "Installing other files"
37 install -m 644 lrusort.py $(PERCONA_SERVER)/scripts
38
39 clean:
40- rm -rf mysql-$(MYSQL_VERSION) $(PERCONA_SERVER)
41+ rm -rf mysql-$(MYSQL_VERSION) $(PERCONA_SERVER) $(PERCONA_SERVER_SHORT_1) $(PERCONA_SERVER_SHORT_2)
42
43=== modified file 'apply_patches'
44--- apply_patches 2011-07-22 16:56:42 +0000
45+++ apply_patches 2011-07-27 11:16:15 +0000
46@@ -1,8 +1,8 @@
47-#!/bin/bash
48+#!/bin/sh
49
50 if [ `which quilt` ]; then
51 echo; echo 'Using quilt'; echo
52- quilt push -a
53+ quilt push -a --quiltrc=quiltrc
54 else
55 echo; echo 'WARNING: Not using quilt, not suitable for dev environment';
56 echo;
57
58=== renamed file 'install_tests.sh' => 'install_tests'
59--- install_tests.sh 2011-07-22 16:56:42 +0000
60+++ install_tests 2011-07-27 11:16:15 +0000
61@@ -30,7 +30,7 @@
62 current=0;
63 count=`wc -l patches/series`;
64 install_path mysql-test "global" $current $count
65-for test_name in `cat series`; do
66+for test_name in `cat patches/series`; do
67 current=$((current+1));
68 install_path mysql-test/$test_name $test_name $current $count
69 done
70
71=== renamed file 'normalize_patches.sh' => 'normalize_patches'
72--- normalize_patches.sh 2011-06-22 10:48:58 +0000
73+++ normalize_patches 2011-07-27 11:16:15 +0000
74@@ -1,51 +1,6 @@
75-#!/usr/bin/env bash
76-
77-MYSQL_VERSION="$(grep ^MYSQL_VERSION= "Makefile" \
78- | cut -d = -f 2)"
79-PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= "Makefile" \
80- | cut -d = -f 2)"
81-PERCONA_SERVER="Percona-Server-${MYSQL_VERSION}-${PERCONA_SERVER_VERSION}"
82-MYSQL_DIR=mysql-${MYSQL_VERSION}
83-MYSQL_TAR_GZ=${MYSQL_DIR}.tar.gz
84-
85-echo "===== Prepare source code for patch's adaptation...";
86-echo "===== Remove 'a' copy...";
87-rm -rf a;
88-echo "===== Remove 'b' copy..."
89-rm -rf b;
90-echo "===== Remove '${PERCONA_SERVER}' copy..."
91-rm -rf ${PERCONA_SERVER};
92-echo "===== Unpack ${MYSQL_DIR} to ${PERCONA_SERVER}..."
93-tar zxf ${MYSQL_TAR_GZ};
94-mv ${MYSQL_DIR} ${PERCONA_SERVER};
95-echo "===== Prepare 'a' copy..."
96-cp -R ${PERCONA_SERVER} a;
97-echo "===== Prepare 'b' copy..."
98-cp -R ${PERCONA_SERVER} b;
99-echo "===== Ok, let's go patch adaptation..."
100-for patch_name in `cat series`; do
101- echo "========================================================="
102- echo "===== Check patch $patch_name";
103- echo "===== Apply patch $patch_name...";
104- patch -p1 -d b < $patch_name >result;
105- fail=`cat result | grep FAIL | wc -l`;
106- hunk=`cat result | grep Hunk | wc -l`;
107- echo "===== Patch $patch_name FAILED: $fail";
108- echo "===== Patch $patch_name HUNK: $hunk";
109- if [ $fail -ne 0 ]; then
110- echo "===== Patch $patch_name are failed";
111- exit 1;
112- fi;
113- if [ $hunk -ne 0 ]; then
114- ./regenerate_patch.sh a b $patch_name
115- fi;
116- patch -p1 -d ${PERCONA_SERVER} < $patch_name > /dev/null;
117- patch -p1 -d a < $patch_name > /dev/null;
118- echo "===== Patch $patch_name regenerated succesfully"
119- if [ $hunk -ne 0 ]; then
120- echo "===== Remove temporary 'b' version"
121- rm -rf b;
122- echo "===== Prepare 'b' copy..."
123- cp -R ${PERCONA_SERVER} b;
124- fi;
125+#!/bin/sh
126+
127+for patch_name in `cat patches/series`; do
128+ quilt push ${patch_name} --quiltrc=quiltrc;
129+ quilt refresh --quiltrc=quiltrc;
130 done;
131
132=== modified file 'quiltrc'
133--- quiltrc 2011-07-22 16:56:42 +0000
134+++ quiltrc 2011-07-27 11:16:15 +0000
135@@ -1,3 +1,8 @@
136 QUILT_NO_DIFF_TIMESTAMPS=1
137 QUILT_NO_DIFF_INDEX=1
138-QUILT_REFRESH_ARGS="-pab"
139+QUILT_REFRESH_OPTS="-ruN"
140+QUILT_REFRESH_ARGS="-p ab"
141+QUILT_DIFF_OPTS="-ruN"
142+QUILT_DIFF_ARGS="-p ab"
143+QUILT_PATCH_OPTS="-ruN"
144+QUILT_PATCH_ARGS="-p ab"
145
146=== removed file 'regenerate_patch.sh'
147--- regenerate_patch.sh 2010-12-09 18:30:58 +0000
148+++ regenerate_patch.sh 1970-01-01 00:00:00 +0000
149@@ -1,46 +0,0 @@
150-#!/usr/bin/env sh
151-a=$1
152-b=$2
153-patch_name=$3
154-prefix="[$patch_name]"
155-big_prefix="$prefix ===== "
156-echo "$big_prefix Regenerate patch $patch_name based thought $a and $b"
157-echo "$big_prefix Header is:"
158-cat $patch_name | head -n7;
159-echo "$big_prefix Ok, let's go:"
160-patch_name_new=$patch_name.new;
161-patch_name_split=$patch_name.split;
162-echo "$prefix Remove $patch_name_new if exists..."
163-rm -f $patch_name_new;
164-echo "$prefix Remove $patch_name_split if exists..."
165-rm -rf $patch_name_split;
166-echo "$prefix Create $patch_name_split"
167-mkdir $patch_name_split;
168-cd $patch_name_split;
169-echo "$prefix Add header"
170-cat ../$patch_name | head -n7 > ../$patch_name_new
171-echo "$prefix Split to separated files"
172-for filename in `splitdiff -a -d ../$patch_name | awk '{ print $2 }' | sed -e "s/>//g"`; do
173- echo "$prefix extract diff metainformation from $filename"
174- a_head=`cat $filename | head -n2 | head -n1`;
175- b_head=`cat $filename | head -n2 | tail -n1`;
176- a_path=`echo $a_head | awk '{ print $2 }'`;
177- b_path=`echo $b_head | awk '{ print $2 }'`;
178- diff_string="diff -ruN $a_path $b_path";
179- echo "$big_prefix $filename metainformation is:";
180- echo "$prefix $diff_string";
181- echo "$prefix $a_head"
182- echo "$prefix $b_head"
183- echo "$big_prefix Update patch by $filename"
184- (cd ..; echo $diff_string >> $patch_name_new);
185- (cat $filename | head -n2 | head -n1 >> ../$patch_name_new);
186- (cat $filename | head -n2 | tail -n1 >> ../$patch_name_new);
187- (cd ..; diff -ruN $a_path $b_path | tail -n+3 >> $patch_name_new);
188-done;
189-cd ..;
190-echo "$prefix Rename temporary patch to final"
191-cat $patch_name_new > $patch_name;
192-echo "$prefix Remove temporary files"
193-rm $patch_name_new;
194-rm -rf $patch_name_split;
195-echo "$big_prefix Complete"

Subscribers

People subscribed via source and target branches

to all changes: