[94727] trunk/dports/databases/mysql51/Portfile
Ryan Schmidt
ryandesign at macports.org
Wed Jun 27 14:57:04 PDT 2012
On Jun 27, 2012, at 16:25, pixilla at macports.org wrote:
> Revision: 94727
> https://trac.macports.org/changeset/94727
> Author: pixilla at macports.org
> Date: 2012-06-27 14:25:48 -0700 (Wed, 27 Jun 2012)
> Log Message:
> -----------
> databases/mysql51:
> - Add revision test to registry_deactivate.
>
> Modified Paths:
> --------------
> trunk/dports/databases/mysql51/Portfile
>
> Modified: trunk/dports/databases/mysql51/Portfile
> ===================================================================
> --- trunk/dports/databases/mysql51/Portfile 2012-06-27 19:11:15 UTC (rev 94726)
> +++ trunk/dports/databases/mysql51/Portfile 2012-06-27 21:25:48 UTC (rev 94727)
> @@ -7,7 +7,7 @@
> set name_mysql ${name}
> version 5.1.63
> # Please set revision_client and revision_server to 0 if you bump version.
> -set revision_client 4
> +set revision_client 5
> set revision_server 3
> categories databases
> platforms darwin
> @@ -166,7 +166,8 @@
> pre-activate {
> if { [file exists ${prefix}/etc/${name_mysql}/macports-default.cnf]
> && ![catch {set vers [lindex [registry_active ${name_mysql}-server] 0]}]
> - && [vercmp [lindex $vers 1] 5.1.63] < 0 } {
> + && [vercmp [lindex $vers 1] 5.1.63] < 1
> + && [vercmp [lindex $vers 2] 3] < 0 } {
One doesn't really use any value other than 0 when testing the result of vercmp. The only guarantee of cmp functions like vercmp is that they will return a number less than zero, greater than zero, or zero:
"[vercmp $v 1.2.3] < 0" is true when $v is less than 1.2.3
"[vercmp $v 1.2.3] > 0" is true when $v is greater than 1.2.3
"[vercmp $v 1.2.3 == 0] is true when $v is equal to 1.2.3
What you should really be testing is two separate things:
1. The version is less than 5.1.63
or
2. The version is equal to 5.1.63 and the revision is less than 3
Those are the conditions under which you want to perform the deactivate hack.
More information about the macports-dev
mailing list