Merge lp:~ignacio-nin/percona-xtradb-cluster/pxc-bug1181753 into lp:percona-xtradb-cluster/percona-xtradb-cluster-5.5

Proposed by Ignacio Nin on 2013-06-05
Status: Merged
Approved by: Raghavendra D Prabhu on 2013-06-06
Approved revision: 388
Merged at revision: 388
Proposed branch: lp:~ignacio-nin/percona-xtradb-cluster/pxc-bug1181753
Merge into: lp:percona-xtradb-cluster/percona-xtradb-cluster-5.5
Diff against target: 67 lines (+32/-4)
1 file modified
build/percona-xtradb-cluster.spec (+32/-4)
To merge this branch: bzr merge lp:~ignacio-nin/percona-xtradb-cluster/pxc-bug1181753
Reviewer Review Type Date Requested Status
Percona core 2013-06-05 Pending
Review via email: mp+167585@code.launchpad.net
To post a comment you must log in.

I see an issue here:

mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`

my_print_defaults requires a cnf installed. But it looks like it is called during post-install in all places?

If yes, then fine.

Ignacio Nin (ignacio-nin) wrote :

Hello,

Yes, it's called as part of post-install scripts.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build/percona-xtradb-cluster.spec'
2--- build/percona-xtradb-cluster.spec 2013-04-23 05:19:16 +0000
3+++ build/percona-xtradb-cluster.spec 2013-06-05 16:06:53 +0000
4@@ -621,7 +621,16 @@
5
6 # ATTENTION: Parts of this are duplicated in the "triggerpostun" !
7
8-mysql_datadir=%{mysqldatadir}
9+# There are users who deviate from the default file system layout.
10+# Check local settings to support them.
11+if [ -x %{_bindir}/my_print_defaults ]
12+then
13+ mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
14+fi
15+if [ -z "$mysql_datadir" ]
16+then
17+ mysql_datadir=%{mysqldatadir}
18+fi
19 # Check if we can safely upgrade. An upgrade is only safe if it's from one
20 # of our RPMs in the same version family.
21
22@@ -778,7 +787,16 @@
23 fi
24 # ATTENTION: Parts of this are duplicated in the "triggerpostun" !
25
26-mysql_datadir=%{mysqldatadir}
27+# There are users who deviate from the default file system layout.
28+# Check local settings to support them.
29+if [ -x %{_bindir}/my_print_defaults ]
30+then
31+ mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
32+fi
33+if [ -z "$mysql_datadir" ]
34+then
35+ mysql_datadir=%{mysqldatadir}
36+fi
37 NEW_VERSION=%{mysql_version}-%{release}
38 STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
39
40@@ -815,7 +833,8 @@
41 if [ ! -d $mysql_datadir/test ]; then
42 mkdir $mysql_datadir/test;
43 fi
44-%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
45+%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user} \
46+ --datadir=$mysql_datadir
47 fi
48 # ----------------------------------------------------------------------
49 # Make MySQL start/shutdown automatically when the machine does it.
50@@ -943,7 +962,16 @@
51 # http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch10s02.html
52 # For all details of this code, see the "pre" and "post" sections.
53
54-mysql_datadir=%{mysqldatadir}
55+# There are users who deviate from the default file system layout.
56+# Check local settings to support them.
57+if [ -x %{_bindir}/my_print_defaults ]
58+then
59+ mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
60+fi
61+if [ -z "$mysql_datadir" ]
62+then
63+ mysql_datadir=%{mysqldatadir}
64+fi
65 NEW_VERSION=%{mysql_version}-%{release}
66 STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER-LAST # Note the difference!
67 STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY

Subscribers

People subscribed via source and target branches

to all changes: