New Ticket     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #13410 (closed enhancement: fixed)

Opened 4 years ago

Last modified 3 years ago

Add mysql5-devel support to py25-mysql

Reported by: ebgssth@… Owned by: stechert@…
Priority: Normal Milestone:
Component: ports Version: 1.5.2
Keywords: python mysql Cc: ryandesign@…
Port: py25-mysql

Description

Please add support mysql5-devel to py25-mysql

Attachments

Portfile.diff Download (380 bytes) - added by ebgssth@… 4 years ago.
Portfile-py25-mysql.diff Download (1.5 KB) - added by ryandesign@… 4 years ago.

Change History

Changed 4 years ago by ebgssth@…

Changed 4 years ago by ebgssth@…

Tested on my box and it worked fine.

Changed 4 years ago by stechert@…

  • status changed from new to assigned
  • owner changed from macports-dev@… to stechert@…

Changed 4 years ago by stechert@…

  • status changed from assigned to closed
  • resolution set to fixed

Changed 4 years ago by ryandesign@…

  • cc ryandesign@… added; stechert@… removed
  • status changed from closed to reopened
  • resolution fixed deleted

This was not a good change. First, hyphens are illegal in variant names (#14141, #14147). Second, there should not be variants that depend on *-devel versions of ports if the regular version would also work. Rather, the port should depend on the normal version of the port in such a way that if the corresponding *-devel version is already installed, it will be used instead. This is not yet documented because I'm bringing it up on macports-dev first.

I am modifying mysql5-devel so that it installs files into the same place as mysql5; see #14142. Then (if it does not already) it should work as a drop-in replacement for mysql5.

I will attach a new patch which makes the following changes:

  • Fixes patchfile names to match guidelines
  • Adds variant descriptions
  • Removes mysql5-devel variant and adds mysql5 variant which depends on ${prefix}/bin/mysql_config5 so that the mysql5-devel port would also satisfy the dependency
  • Makes mysql5 the default variant, if mysql3 or mysql4 have not been selected
  • Fixes mysql3 variant (was broken because it depended on mysql port which does not exist; port is called mysql3)
  • Issues a warning if none of mysql3, mysql4 or mysql5 are selected (user would have to go out of their way to make this happen)

If you have any questions let me know.

Changed 4 years ago by ryandesign@…

Changed 4 years ago by ryandesign@…

I knew I would forget one. The patch also:

  • marks mysql3, mysql4 and mysql5 as conflicting with one another

Changed 4 years ago by ryandesign@…

I should mention that I did not test my changes because I don't use Python, so please test before committing.

Changed 4 years ago by ebgssth@…

oops

$ sudo port install py25-mysql
-snip-

--->  Fetching py25-mysql
--->  Attempting to fetch patch-_mysql.c.diff from http://svn.macports.org/repository/macports/distfiles/py25-mysql
--->  Attempting to fetch patch-_mysql.c.diff from http://svn.macports.org/repository/macports/distfiles/general/
--->  Attempting to fetch patch-_mysql.c.diff from http://svn.macports.org/repository/macports/downloads/py25-mysql
Error: Target org.macports.fetch returned: fetch failed
Error: Status 1 encountered during processing.

Changed 4 years ago by ryandesign@…

Yes, like I said, my patch fixes the patchfile names to match the guidelines. After you apply the patch to the portfile, you must rename the files patch-_mysql.c and patch-setup_posix.py to their correct names, patch-_mysql.c.diff and patch-setup_posix.py.diff.

Changed 4 years ago by ebgssth@…

Looks ok to me.

% port installed |grep mysql
  mysql5-devel @5.1.22-rc_1+darwin_8+server (active)
  py25-mysql @1.2.2_0+mysql5 (active)

% cd MySQL-python-1.2.2
% for i in test_*.py; do echo Testing $i; sudo python2.5 $i; done
Testing test_MySQLdb_capabilities.py
.................
----------------------------------------------------------------------
Ran 17 tests in 0.508s

OK
Testing test_MySQLdb_dbapi20.py
...................................
----------------------------------------------------------------------
Ran 35 tests in 0.140s

OK
Testing test_capabilities.py

Changed 4 years ago by ebgssth@…

Any problem?

Changed 4 years ago by ryandesign@…

  • status changed from reopened to closed
  • resolution set to fixed
  • summary changed from Add mysql5-devel variant to py25-mysql to Add mysql5-devel support to py25-mysql

Committed in r34152, and I filed ticket #14339 to get these changes picked up by py-mysql as well.

Changed 3 years ago by ryandesign@…

Small problem in my fix: variables are not expanded in depspecs, and "${prefix}/" is prepended to relative paths in path depspecs, so "${prefix}/" should not have been included in the mysql5 dependency. Removed that in r46012.

Changed 3 years ago by ryandesign@…

  • port set to py25-mysql

Changed 3 years ago by anonymous

  • milestone Port Enhancements deleted

Milestone Port Enhancements deleted

Note: See TracTickets for help on using tickets.