1 |
Hi. |
2 |
|
3 |
On 18-04-2011 23:02, Ulrich Mueller wrote: |
4 |
>>>>>> On Mon, 18 Apr 2011, Jorge Manuel B S Vicetto wrote: |
5 |
> |
6 |
>> The mysql team now uses 3 eclasses: mysql-v2.eclass[2] (base |
7 |
>> eclass), mysql-autotools.eclass[3] (for autotools based releases) |
8 |
>> and mysql-cmake.eclass[4] (for cmake based releases). The first 2 |
9 |
>> eclasses are complete, pending any updates from the review. The |
10 |
>> mysql-cmake eclass is still under development, but can also benefit |
11 |
>> from a review. |
12 |
> |
13 |
> I didn't go through all of it, but here are a few things that I've |
14 |
> noticed in mysql-v2.eclass: |
15 |
|
16 |
Thank you Ulrich for the review. |
17 |
I'm attaching the diff to this email, but the commitdiff can also be |
18 |
seen in the overlay - |
19 |
http://git.overlays.gentoo.org/gitweb/?p=proj/mysql.git;a=commitdiff;h=7cd4cedb1dcade2a63018fc82a2622606c524126 |
20 |
|
21 |
>> # @ECLASS: mysql.eclass |
22 |
> |
23 |
> Shouldn't this match the filename of the eclass? (Same for |
24 |
> mysql-autotools.eclass.) |
25 |
|
26 |
Fixed. |
27 |
|
28 |
>> # @DESCRIPTION: |
29 |
>> # The mysql.eclass provides almost all the code to build the mysql ebuilds |
30 |
>> # including the src_unpack, src_prepare, src_configure, src_compile, |
31 |
>> # scr_install, pkg_preinst, pkg_postinst, pkg_config and pkg_postrm |
32 |
>> # phase hooks. |
33 |
> |
34 |
> Name of the eclass should be updated. |
35 |
|
36 |
Fixed. |
37 |
|
38 |
>> MYSQL_EXPF="src_unpack src_compile src_install" |
39 |
>> case "${EAPI:-0}" in |
40 |
>> 2|3|4) MYSQL_EXPF+=" src_prepare src_configure" ;; |
41 |
>> *) die "Unsupported EAPI: ${EAPI}" ;; |
42 |
>> esac |
43 |
> |
44 |
>> EXPORT_FUNCTIONS ${MYSQL_EXPF} |
45 |
> |
46 |
> You don't need a global variable here: |
47 |
> ,---- |
48 |
> | EXPORT_FUNCTIONS src_unpack src_compile src_install |
49 |
> | case "${EAPI:-0}" in |
50 |
> | 2|3|4) EXPORT_FUNCTIONS src_prepare src_configure ;; |
51 |
> | *) die "Unsupported EAPI: ${EAPI}" ;; |
52 |
> | esac |
53 |
> `---- |
54 |
> |
55 |
> or even: |
56 |
> ,---- |
57 |
> | case "${EAPI:-0}" in |
58 |
> | 2|3|4) ;; |
59 |
> | *) die "Unsupported EAPI: ${EAPI}" ;; |
60 |
> | esac |
61 |
> | EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install |
62 |
> `---- |
63 |
|
64 |
I was following base.eclass example, but switched to the last |
65 |
alternative you presented. |
66 |
|
67 |
>> # @ECLASS-VARIABLE: XTRADB_VER |
68 |
>> # @DESCRIPTION: |
69 |
>> # Version of the XTRADB storage engine |
70 |
>> XTRADB_VER="${XTRADB_VER}" |
71 |
> |
72 |
> Is this assignment needed, or could you use @DEFAULT_UNSET instead? |
73 |
> (Assuming it's for the eclass manpage.) Same for other variables. |
74 |
|
75 |
Did you mean using ": ${XTRADB_VER:=}"? Done. |
76 |
|
77 |
>> # Having different flavours at the same time is not a good idea |
78 |
>> for i in "mysql" "mysql-community" "mysql-cluster" "mariadb" ; do |
79 |
>> [[ "${i}" == ${PN} ]] || |
80 |
> |
81 |
> Quotes are not necessary here. |
82 |
|
83 |
Fixed. |
84 |
|
85 |
>> pbxt_patch_available \ |
86 |
>> && PBXT_P="pbxt-${PBXT_VERSION}" \ |
87 |
>> && PBXT_SRC_URI="http://www.primebase.org/download/${PBXT_P}.tar.gz mirror://sourceforge/pbxt/${PBXT_P}.tar.gz" \ |
88 |
>> && SRC_URI="${SRC_URI} pbxt? ( ${PBXT_SRC_URI} )" \ |
89 |
> |
90 |
>> # PBXT_NEWSTYLE means pbxt is in storage/ and gets enabled as other plugins |
91 |
>> # vs. built outside the dir |
92 |
>> pbxt_available \ |
93 |
>> && IUSE="${IUSE} pbxt" \ |
94 |
>> && mysql_version_is_at_least "5.1.40" \ |
95 |
>> && PBXT_NEWSTYLE=1 |
96 |
> |
97 |
>> xtradb_patch_available \ |
98 |
>> && XTRADB_P="percona-xtradb-${XTRADB_VER}" \ |
99 |
>> && XTRADB_SRC_URI_COMMON="${PERCONA_VER}/source/${XTRADB_P}.tar.gz" \ |
100 |
>> && XTRADB_SRC_B1="http://www.percona.com/" \ |
101 |
>> && XTRADB_SRC_B2="${XTRADB_SRC_B1}/percona-builds/" \ |
102 |
>> && XTRADB_SRC_URI1="${XTRADB_SRC_B2}/Percona-Server/Percona-Server-${XTRADB_SRC_URI_COMMON}" \ |
103 |
>> && XTRADB_SRC_URI2="${XTRADB_SRC_B2}/xtradb/${XTRADB_SRC_URI_COMMON}" \ |
104 |
>> && XTRADB_SRC_URI3="${XTRADB_SRC_B1}/${PN}/xtradb/${XTRADB_SRC_URI_COMMON}" \ |
105 |
>> && SRC_URI="${SRC_URI} xtradb? ( ${XTRADB_SRC_URI1} ${XTRADB_SRC_URI2} ${XTRADB_SRC_URI3} )" \ |
106 |
>> && IUSE="${IUSE} xtradb" |
107 |
> |
108 |
> Probably a matter of taste, but I'd use "if" blocks instead of the |
109 |
> multiple && here. |
110 |
|
111 |
I switched to if blocks here. |
112 |
|
113 |
>> mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ |
114 |
> |
115 |
> Both options --strip-trailing-slashes and -T are GNUisms and may not |
116 |
> exist on other userlands (like BSD). |
117 |
|
118 |
I'll let Robin take a look at this one. |
119 |
|
120 |
> Ulrich |
121 |
|
122 |
-- |
123 |
Regards, |
124 |
|
125 |
Jorge Vicetto (jmbsvicetto) - jmbsvicetto at gentoo dot org |
126 |
Gentoo- forums / Userrel / Devrel / KDE / Elections / RelEng |