Revision: 32364 http://trac.macosforge.org/projects/macports/changeset/32364 Author: jmpp@macports.org Date: 2007-12-27 12:07:33 -0800 (Thu, 27 Dec 2007) Log Message: ----------- Don't use plain arithmetical comparison to determine if the downloaded sources are newer than the installed MacPorts, but rather our own rpm-vercomp to compare $macports_version_new against $macports::autoconf::macports_version. As of this moment, the result is the same (and will be the same when we release 1.xyz, with x > 6 and/or y,z > 0) as the arithmetical comparison, but in the future this change will allow us to introduce real version numbers into MacPorts. My current idea is to create a base/config/macports_version file holding something like 1.6.1, but the selfupdate logic of reading the latter over base/config/mp_version has to be thoroughly thought out: 600 (from base/config/mp_version's 1.600) is greater than 6, so if we flat out select base/config/macports_version to read the new version we will break selfupdating for everyone, as rpm-vercomp will not see 1.6.1 as greater than 1.600. Modified Paths: -------------- trunk/base/src/macports1.0/macports.tcl Modified: trunk/base/src/macports1.0/macports.tcl =================================================================== --- trunk/base/src/macports1.0/macports.tcl 2007-12-27 19:03:53 UTC (rev 32363) +++ trunk/base/src/macports1.0/macports.tcl 2007-12-27 20:07:33 UTC (rev 32364) @@ -1656,14 +1656,14 @@ return -code error "Error: rsync failed in selfupdate" } - # get downloaded MacPorts version and write the old version back + # get downloaded MacPorts version set fd [open [file join $mp_source_path config mp_version] r] gets $fd macports_version_new close $fd ui_msg "\nDownloaded MacPorts base version $macports_version_new" # check if we we need to rebuild base - if {$macports_version_new > $macports::autoconf::macports_version || $use_the_force_luke == "yes"} { + if {[rpm-vercomp $macports_version_new $macports::autoconf::macports_version] > 0 || $use_the_force_luke == "yes"} { ui_msg "Configuring, Building and Installing new MacPorts base" # check if $prefix/bin/port is writable, if so we go ! # get installation user / group