mysql-utilities formula, second attempt at it #22480

Closed
wants to merge 4 commits into
from

Projects

None yet

3 participants

OK, removed the foolishly implemented install of mysql-connector-python dependency in favor of using python/pip dependency checking.

This really is a useful group of utilities.

Hoping this will pass muster.

Contributor
adamv commented Sep 12, 2013

If you make pull requests from non-master branches, you can git push -f to update an existing one in-place.

Doh! I probably should have known that. Thanks for the tip.

@adamv adamv commented on an outdated diff Sep 13, 2013
Library/Formula/mysql-utilities.rb
@@ -0,0 +1,46 @@
+require 'formula'
+
+# install the python-based mysql utilities package
+# it's missing from the OSX install of MySQL Workbench,
+# which makes it not so very useful.
+
+
+class MysqlUtilities < Formula
+ homepage 'http://dev.mysql.com/doc/workbench/en/mysql-utilities.html'
+ url 'http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-utilities-1.3.5.tar.gz/from/http://cdn.mysql.com/'
+ sha1 '1b0fe9eb6cb4f96388f87188abe4b0b7be7efd99'
+
+ version '1.3.5'
adamv
adamv Sep 13, 2013 Contributor

This should go between url and sha1.

@adamv adamv commented on an outdated diff Sep 13, 2013
Library/Formula/mysql-utilities.rb
+
+# install the python-based mysql utilities package
+# it's missing from the OSX install of MySQL Workbench,
+# which makes it not so very useful.
+
+
+class MysqlUtilities < Formula
+ homepage 'http://dev.mysql.com/doc/workbench/en/mysql-utilities.html'
+ url 'http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-utilities-1.3.5.tar.gz/from/http://cdn.mysql.com/'
+ sha1 '1b0fe9eb6cb4f96388f87188abe4b0b7be7efd99'
+
+ version '1.3.5'
+ depends_on 'sphinx'
+ depends_on :python => ['distutils','sphinx','jinja2']
+ depends_on :python => ['mysql.connector' => 'mysql-connector']
+ def install
adamv
adamv Sep 13, 2013 Contributor

Newline above def install

@adamv adamv commented on an outdated diff Sep 13, 2013
Library/Formula/mysql-utilities.rb
+
+class MysqlUtilities < Formula
+ homepage 'http://dev.mysql.com/doc/workbench/en/mysql-utilities.html'
+ url 'http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-utilities-1.3.5.tar.gz/from/http://cdn.mysql.com/'
+ sha1 '1b0fe9eb6cb4f96388f87188abe4b0b7be7efd99'
+
+ version '1.3.5'
+ depends_on 'sphinx'
+ depends_on :python => ['distutils','sphinx','jinja2']
+ depends_on :python => ['mysql.connector' => 'mysql-connector']
+ def install
+ system python, "setup.py", "install"
+ end
+
+ test do
+ system "mysqlauditadmin --help"
adamv
adamv Sep 13, 2013 Contributor

Need to use the full path to the binaries, like: system "#{bin}/mysqlauditgrep", "--help".

But also I don't think dumping the help screen for all these is strictly needed; if one of them runs is it likely that they all will be able to run?

@adamv adamv commented on an outdated diff Sep 13, 2013
Library/Formula/mysql-utilities.rb
+ system "mysqldiff --help"
+ system "mysqldiskusage --help"
+ system "mysqlfailover --help"
+ system "mysqlfrm --help"
+ system "mysqlindexcheck --help"
+ system "mysqlmetagrep --help"
+ system "mysqlprocgrep --help"
+ system "mysqlreplicate --help"
+ system "mysqlrpladmin --help"
+ system "mysqlrplcheck --help"
+ system "mysqlrplshow --help"
+ system "mysqlserverclone --help"
+ system "mysqlserverinfo --help"
+ system "mysqluc --help"
+ system "mysqluserclone --help"
+
adamv
adamv Sep 13, 2013 Contributor

Remove these newlines.

Made the changes other than the one to correct the syntax on executing the binary file in test, which I'm having a spot of trouble with. But will push a commit on that soon.

OK this should clean things up.

@adamv adamv and 1 other commented on an outdated diff Sep 14, 2013
Library/Formula/mysql-utilities.rb
+# which makes it not so very useful.
+
+
+class MysqlUtilities < Formula
+ homepage 'http://dev.mysql.com/doc/workbench/en/mysql-utilities.html'
+ url 'http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-utilities-1.3.5.tar.gz/from/http://cdn.mysql.com/'
+ version '1.3.5'
+ sha1 '1b0fe9eb6cb4f96388f87188abe4b0b7be7efd99'
+
+ depends_on 'sphinx'
+ depends_on :python => ['distutils','sphinx','jinja2']
+ depends_on :python => ['mysql.connector' => 'mysql-connector-python']
+
+ def install
+ system python, "setup.py", "install", "--prefix=#{prefix}"#, "--install-scripts=#{bin}", "--install-lib=#{lib}"
+ system "rm", "#{python.global_site_packages}/mysql/__init__.py"
adamv
adamv Sep 14, 2013 Contributor

Why remove this file?

lathropd
lathropd Sep 14, 2013

When building in the Cellar python creates

Cellar/mysql-utilities/1.3.5/lib/python2.7/site-packages/mysql/init.py

but when brew-link comes in and tries to link to

/usr/lib/python2.7/site-packages/mysql/init.py

It already exists thanks to the mysql.connector package.

This causes brew-link to fail noisily.

lathropd
lathropd Sep 14, 2013

but now that you ask, this should actually be done the other way around since otherwise uninstalling mysql-utilities would break mysql-connector-python.

Has anyone had a chance to look at my most recent change? I think it's good now.

@adamv adamv was assigned Sep 24, 2013
Contributor
adamv commented Sep 25, 2013

Why does the init.py have to be removed again?

lathropd commented Oct 8, 2013

Apologies, thought I'd already responded to this. The init.py file is deleted because it will otherwise try to override the init.py from the mysql package. That generally works fine in pythonspace, but causes a nasty failure when homebrew goes to link the files.

Contributor
adamv commented Oct 8, 2013

We definitely shouldn't be linking init.py files anywhere they would conflict. Which file location specifically?

lathropd commented Oct 8, 2013

MySQL utilities is under the mysql namespace of mysql-connect, which is installed via pypi.

As a result Homebrew attempts to link

Cellar/mysql-utilities/1.3.5/lib/python2.7/site-packages/mysql/init.py

as

/usr/local/lib/python2.7/site-packages/mysql/init.py

and that fails because an actual file, rather than a symlink, is already there.

There certainly could patch that checks for that situation involving python libraries, and if y'all want someone to dig into it I'd be happy to.

-D

@jacknagel jacknagel commented on the diff Oct 9, 2013
Library/Formula/mysql-utilities.rb
@@ -0,0 +1,26 @@
+require 'formula'
+
+# install the python-based mysql utilities package
+# it's missing from the OSX install of MySQL Workbench,
+# which makes it not so very useful.
+
+
+class MysqlUtilities < Formula
+ homepage 'http://dev.mysql.com/doc/workbench/en/mysql-utilities.html'
+ url 'http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-utilities-1.3.5.tar.gz/from/http://cdn.mysql.com/'
+ version '1.3.5'
+ sha1 '1b0fe9eb6cb4f96388f87188abe4b0b7be7efd99'
+
+ depends_on 'sphinx'
+ depends_on :python => ['distutils','sphinx','jinja2']
jacknagel
jacknagel Oct 9, 2013 Contributor

Isn't distutils included with python? I don't think we need to specify this.

Contributor
adamv commented Nov 5, 2013

Ping on Jack's question about Python. distutils is pretty standard, we don't need to ask for it. Was there a reason it was included in the patch list?

@adamv adamv commented on the diff Nov 5, 2013
Library/Formula/mysql-utilities.rb
@@ -0,0 +1,26 @@
+require 'formula'
+
+# install the python-based mysql utilities package
adamv
adamv Nov 5, 2013 Contributor

Please remove this comment block.

@adamv adamv commented on the diff Nov 5, 2013
Library/Formula/mysql-utilities.rb
+# which makes it not so very useful.
+
+
+class MysqlUtilities < Formula
+ homepage 'http://dev.mysql.com/doc/workbench/en/mysql-utilities.html'
+ url 'http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-utilities-1.3.5.tar.gz/from/http://cdn.mysql.com/'
+ version '1.3.5'
+ sha1 '1b0fe9eb6cb4f96388f87188abe4b0b7be7efd99'
+
+ depends_on 'sphinx'
+ depends_on :python => ['distutils','sphinx','jinja2']
+ depends_on :python => ['mysql.connector' => 'mysql-connector-python']
+
+ def install
+ system python, "setup.py", "install", "--prefix=#{prefix}"#, "--install-scripts=#{bin}", "--install-lib=#{lib}"
+ system "rm", "#{python.site_packages}/mysql/__init__.py"
adamv
adamv Nov 5, 2013 Contributor

I asked this before, but I'm going to ask it again, why is this file being removed?

Contributor
adamv commented Feb 11, 2014

Ping on the outstanding questions in the code review

Contributor

Closing due to no response.

@jacknagel jacknagel closed this Apr 3, 2014
lathropd commented Apr 3, 2014

Sorry! Totally missed the last message.

Is it too late now?


Daniel Lathrop
206.718.0349 (cell)

On Wed, Apr 2, 2014 at 10:26 PM, Jack Nagel notifications@github.comwrote:

Closed #22480 #22480.


Reply to this email directly or view it on GitHubhttps://github.com/Homebrew/homebrew/pull/22480
.

Contributor

Nope! Just trying to close out stale issues.

@jacknagel jacknagel reopened this Apr 3, 2014
Contributor
adamv commented Apr 19, 2014

Any updates here?

Will work on it Sunday.


Daniel Lathrop
206.718.0349 (cell)

On Sat, Apr 19, 2014 at 11:09 AM, Adam Vandenberg
notifications@github.comwrote:

Any updates here?


Reply to this email directly or view it on GitHubhttps://github.com/Homebrew/homebrew/pull/22480#issuecomment-40873266
.

Contributor

Closing as stale again, but we can reopen if you find some time to work on it.

@jacknagel jacknagel closed this May 7, 2014
@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.