Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#13410 closed enhancement (fixed)

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 (Ryan Carsten Schmidt)
Port: py25-mysql

Description

Please add support mysql5-devel to py25-mysql

Attachments (2)

Portfile.diff (380 bytes) - added by ebgssth@… 16 years ago.
Portfile-py25-mysql.diff (1.5 KB) - added by ryandesign (Ryan Carsten Schmidt) 16 years ago.

Download all attachments as: .zip

Change History (16)

Changed 16 years ago by ebgssth@…

Attachment: Portfile.diff added

comment:1 Changed 16 years ago by ebgssth@…

Tested on my box and it worked fine.

comment:2 Changed 16 years ago by stechert@…

Owner: changed from macports-dev@… to stechert@…
Status: newassigned

comment:3 Changed 16 years ago by stechert@…

Resolution: fixed
Status: assignedclosed

comment:4 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added; stechert@… removed
Resolution: fixed
Status: closedreopened

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 16 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: Portfile-py25-mysql.diff added

comment:5 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

I knew I would forget one. The patch also:

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

comment:6 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

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

comment:7 Changed 16 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.

comment:8 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

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.

comment:9 Changed 16 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

comment:10 Changed 16 years ago by ebgssth@…

Any problem?

comment:11 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: reopenedclosed
Summary: Add mysql5-devel variant to py25-mysqlAdd 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.

comment:12 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

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.

comment:13 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Port: py25-mysql added

comment:14 Changed 15 years ago by (none)

Milestone: Port Enhancements

Milestone Port Enhancements deleted

Note: See TracTickets for help on using tickets.