Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/mysql:master commit in: dev-db/mysql-init-scripts/, dev-db/mysql-init-scripts/files/
Date: Thu, 28 May 2015 12:54:09
Message-Id: 1432817726.7ea5eeb49381fcdfbdee1714ef2eea9023411993.grknight@gentoo
1 commit: 7ea5eeb49381fcdfbdee1714ef2eea9023411993
2 Author: layman <layman <AT> localhost>
3 AuthorDate: Thu May 28 12:55:26 2015 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Thu May 28 12:55:26 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/mysql.git/commit/?id=7ea5eeb4
7
8 [mysql-init-scripts] Version bump and header sync from portage
9
10 dev-db/mysql-init-scripts/files/init.d-s6 | 11 +++++++-
11 dev-db/mysql-init-scripts/files/log-s6 | 4 +--
12 dev-db/mysql-init-scripts/files/run-s6 | 17 +++---------
13 dev-db/mysql-init-scripts/metadata.xml | 3 ---
14 ...ebuild => mysql-init-scripts-2.1_alpha3.ebuild} | 31 ++++++++++++----------
15 5 files changed, 32 insertions(+), 34 deletions(-)
16
17 diff --git a/dev-db/mysql-init-scripts/files/init.d-s6 b/dev-db/mysql-init-scripts/files/init.d-s6
18 index 984c831..f856e1d 100644
19 --- a/dev-db/mysql-init-scripts/files/init.d-s6
20 +++ b/dev-db/mysql-init-scripts/files/init.d-s6
21 @@ -1,7 +1,7 @@
22 #!/sbin/openrc-run
23 # Copyright 1999-2015 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: $
26 +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/init.d-s6,v 1.2 2015/05/27 21:01:03 grknight Exp $
27
28 depend() {
29 use net.lo
30 @@ -41,6 +41,7 @@ start_pre() {
31 fi
32
33 # tail -n1 is critical as these we only want the last instance of the option
34 + local basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
35 local datadir=$(get_config "${MY_CNF}" datadir | tail -n1)
36 local pidfile=$(get_config "${MY_CNF}" pid-file | tail -n1)
37 local socket=$(get_config "${MY_CNF}" socket | tail -n1)
38 @@ -77,6 +78,14 @@ start_pre() {
39 eerror "Directory $piddir for pidfile does not exist and cannot be created"
40 return 1
41 fi
42 +
43 + # Prepare env files to source
44 + mkdir -p "/var/svc.d/${SVCNAME}"
45 + echo "MY_CNF=\"${MY_CNF}\"" > "/var/svc.d/${SVCNAME}/env"
46 + echo "MY_ARGS=\"${MY_ARGS}\"" >> "/var/svc.d/${SVCNAME}/env"
47 + echo "basedir=\"${basedir}\"" >> "/var/svc.d/${SVCNAME}/env"
48 + mkdir -p "/var/svc.d/${SVCNAME}/log"
49 + echo "SVCNAME=\"${SVCNAME}\"" > "/var/svc.d/${SVCNAME}/log/env"
50 }
51
52 start_post() {
53
54 diff --git a/dev-db/mysql-init-scripts/files/log-s6 b/dev-db/mysql-init-scripts/files/log-s6
55 index 965b235..06c2ae3 100644
56 --- a/dev-db/mysql-init-scripts/files/log-s6
57 +++ b/dev-db/mysql-init-scripts/files/log-s6
58 @@ -1,9 +1,9 @@
59 #!/bin/sh
60 # Copyright 1999-2015 Gentoo Foundation
61 # Distributed under the terms of the GNU General Public License v2
62 -# $Header: $
63 +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/log-s6,v 1.2 2015/05/27 21:01:03 grknight Exp $
64
65 -SVCNAME=$(cd `dirname $0` && pwd | awk -F/ '{ print $--NF }' )
66 +if [ -e ./env ] ; then source ./env ; else echo "failed to source env" ; fi
67 mkdir -p "/var/log/mysql/${SVCNAME}"
68 if [ ${S6_LOG_OPTIONS} ] ; then
69 exec s6-log ${S6_LOG_OPTIONS}
70
71 diff --git a/dev-db/mysql-init-scripts/files/run-s6 b/dev-db/mysql-init-scripts/files/run-s6
72 index a9615a1..aa83d84 100644
73 --- a/dev-db/mysql-init-scripts/files/run-s6
74 +++ b/dev-db/mysql-init-scripts/files/run-s6
75 @@ -1,18 +1,7 @@
76 #!/bin/sh
77 # Copyright 1999-2015 Gentoo Foundation
78 # Distributed under the terms of the GNU General Public License v2
79 -# $Header: $
80 +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/run-s6,v 1.2 2015/05/27 21:01:03 grknight Exp $
81
82 -get_config() {
83 - my_print_defaults --config-file="$1" mysqld |
84 - sed -n -e "s/^--$2=//p"
85 -}
86 -
87 -SVCNAME=$(cd `dirname $0` && pwd | awk -F/ '{ print $NF }' )
88 -
89 -source "${ROOT:-/}etc/conf.d/${SVCNAME}"
90 -
91 -MY_CNF="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
92 -
93 -basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
94 -exec "${basedir}"/sbin/mysqld --defaults-file="${MY_CNF}" ${MY_ARGS} 2>&1
95 +if [ -e ./env ] ; then source ./env ; else echo "failed to source env" ; fi
96 +exec "${basedir}/sbin/mysqld" --defaults-file="${MY_CNF}" ${MY_ARGS} 2>&1
97
98 diff --git a/dev-db/mysql-init-scripts/metadata.xml b/dev-db/mysql-init-scripts/metadata.xml
99 index c95e8ce..abf3529 100644
100 --- a/dev-db/mysql-init-scripts/metadata.xml
101 +++ b/dev-db/mysql-init-scripts/metadata.xml
102 @@ -2,7 +2,4 @@
103 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
104 <pkgmetadata>
105 <herd>mysql</herd>
106 - <use>
107 - <flag name='s6'>Install an OpenRC service that monitors using <pkg>sys-apps/s6</pkg> instead of using start-stop-daemon</flag>
108 - </use>
109 </pkgmetadata>
110
111 diff --git a/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha2.ebuild b/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha3.ebuild
112 similarity index 55%
113 rename from dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha2.ebuild
114 rename to dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha3.ebuild
115 index ba6ccfc..34eae3b 100644
116 --- a/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha2.ebuild
117 +++ b/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha3.ebuild
118 @@ -1,6 +1,6 @@
119 # Copyright 1999-2015 Gentoo Foundation
120 # Distributed under the terms of the GNU General Public License v2
121 -# $Header: $
122 +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha3.ebuild,v 1.1 2015/05/27 21:01:03 grknight Exp $
123
124 EAPI=5
125
126 @@ -12,31 +12,35 @@ SRC_URI=""
127
128 LICENSE="GPL-2"
129 SLOT="0"
130 -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
131 -IUSE="s6"
132 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
133 +IUSE=""
134
135 DEPEND=""
136 # This _will_ break with MySQL 5.0, 4.x, 3.x
137 # It also NEEDS openrc for the save_options/get_options builtins.
138 +# The s6 support was added after openrc 0.16.2
139 RDEPEND="
140 !<dev-db/mysql-5.1
141 - s6? ( >=sys-apps/openrc-0.16.2 sys-apps/s6 )
142 + !<sys-apps/openrc-0.16.2
143 "
144 # Need to set S due to PMS saying we need it existing, but no SRC_URI
145 S=${WORKDIR}
146
147 src_install() {
148 newconfd "${FILESDIR}/conf.d-2.0" "mysql"
149 - if use s6 ; then
150 - newinitd "${FILESDIR}/init.d-s6" "mysql"
151 - exeinto /var/svc.d/mysql
152 +
153 + # s6 init scripts
154 + if use amd64 || use x86 ; then
155 + newconfd "${FILESDIR}/conf.d-2.0" "mysql-s6"
156 + newinitd "${FILESDIR}/init.d-s6" "mysql-s6"
157 + exeinto /var/svc.d/mysql-s6
158 newexe "${FILESDIR}/run-s6" "run"
159 - exeinto /var/svc.d/mysql/log
160 + exeinto /var/svc.d/mysql-s6/log
161 newexe "${FILESDIR}/log-s6" "run"
162 - else
163 - newinitd "${FILESDIR}/init.d-2.0" "mysql"
164 fi
165
166 + newinitd "${FILESDIR}/init.d-2.0" "mysql"
167 +
168 # systemd unit installation
169 exeinto /usr/libexec
170 doexe "${FILESDIR}"/mysqld-wait-ready
171 @@ -49,8 +53,7 @@ src_install() {
172 }
173
174 pkg_postinst() {
175 - if use s6 ; then
176 - einfo "If you wish to use s6 logging support, "
177 - einfo "comment out the log-error setting in your my.cnf"
178 - fi
179 + einfo "To use the mysql-s6 script, you need to install the optional sys-apps/s6 package."
180 + einfo "If you wish to use s6 logging support, "
181 + einfo "comment out the log-error setting in your my.cnf"
182 }