Changeset 37349 for trunk/base/src
- Timestamp:
- 06/04/08 01:32:15 (6 months ago)
- Location:
- trunk/base/src
- Files:
-
- 5 modified
-
macports1.0/macports.tcl (modified) (10 diffs)
-
port/port.tcl (modified) (6 diffs)
-
registry1.0/portimage.tcl (modified) (4 diffs)
-
registry1.0/portuninstall.tcl (modified) (2 diffs)
-
registry1.0/receipt_flat.tcl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/base/src/macports1.0/macports.tcl
r37316 r37349 1895 1895 # fill array with information 1896 1896 array set portinfo [lindex $result 1] 1897 # set portname again since the one we were passed may not have had the correct case 1898 set portname $portinfo(name) 1897 1899 1898 1900 # set version_in_tree and revision_in_tree … … 1953 1955 set version_installed $version_in_tree 1954 1956 set revision_installed $revision_in_tree 1957 set iname $portname 1955 1958 # That was a very dirty hack showing how ugly our depencendy and upgrade code is. 1956 1959 # To get it working when user provides -f, we also need to set the variant to … … 1970 1973 || ([rpm-vercomp $version $version_installed] == 0 1971 1974 && [rpm-vercomp $revision $revision_installed] > 0)} { 1975 set iname [lindex $i 0] 1972 1976 set version_installed $version 1973 1977 set revision_installed $revision 1974 1978 set variant_installed $variant 1975 set epoch_installed [registry::property_retrieve [registry::open_entry $ portname [lindex $i 1] [lindex $i 2] $variant] epoch]1979 set epoch_installed [registry::property_retrieve [registry::open_entry $iname [lindex $i 1] [lindex $i 2] $variant] epoch] 1976 1980 set num $i 1977 1981 } … … 1980 1984 if {$isactive == 1} { 1981 1985 set anyactive yes 1986 set active_name [lindex $i 0] 1982 1987 set version_active $version 1983 1988 set revision_active $revision … … 1989 1994 || [string compare $variant_installed $variant_active] != 0)} { 1990 1995 # deactivate version 1991 if {[catch {portimage::deactivate $ portname ${version_active}_${revision_active}${variant_active} $optionslist} result]} {1996 if {[catch {portimage::deactivate $active_name ${version_active}_${revision_active}${variant_active} $optionslist} result]} { 1992 1997 global errorInfo 1993 1998 ui_debug "$errorInfo" 1994 ui_error "Deactivating $ portname @${version_active}_${revision_active} failed: $result"1999 ui_error "Deactivating $active_name @${version_active}_${revision_active} failed: $result" 1995 2000 return 1 1996 2001 } … … 1998 2003 if { [lindex $num 4] == 0 && 0 == [string compare "image" ${macports::registry.installtype}] } { 1999 2004 # activate the latest installed version 2000 if {[catch {portimage::activate $ portname ${version_installed}_${revision_installed}$variant $optionslist} result]} {2005 if {[catch {portimage::activate $iname ${version_installed}_${revision_installed}$variant $optionslist} result]} { 2001 2006 global errorInfo 2002 2007 ui_debug "$errorInfo" 2003 ui_error "Activating $ portname @${version_installed}_${revision_installed} failed: $result"2008 ui_error "Activating $iname @${version_installed}_${revision_installed} failed: $result" 2004 2009 return 1 2005 2010 } … … 2010 2015 ui_debug "epoch: in tree: $epoch_in_tree installed: $epoch_installed" 2011 2016 ui_debug "$portname ${version_in_tree}_$revision_in_tree exists in the ports tree" 2012 ui_debug "$ portname ${version_installed}_$revision_installed is installed"2017 ui_debug "$iname ${version_installed}_$revision_installed is installed" 2013 2018 2014 2019 # set the nodeps option … … 2077 2082 && [rpm-vercomp $revision_installed $revision_in_tree] >= 0 )) 2078 2083 && ![info exists options(ports_force)] } { 2079 ui_debug "No need to upgrade! $ portname ${version_installed}_$revision_installed >= $portname ${version_in_tree}_$revision_in_tree"2084 ui_debug "No need to upgrade! $iname ${version_installed}_$revision_installed >= $portname ${version_in_tree}_$revision_in_tree" 2080 2085 if { $epoch_installed >= $epoch_in_tree } { 2081 2086 # Check if we have to do dependents … … 2085 2090 2086 2091 registry::open_dep_map 2087 set deplist [registry::list_dependents $ portname]2092 set deplist [registry::list_dependents $iname] 2088 2093 2089 2094 if { [llength deplist] > 0 } { … … 2154 2159 if {[info exists options(port_uninstall_old)] || $epoch_override == 1 || [info exists options(ports_force)] || 0 != [string compare "image" ${macports::registry.installtype}] } { 2155 2160 # uninstall old 2156 ui_debug "Uninstalling $ portname ${version_installed}_$revision_installed$oldvariant"2157 if {[catch {portuninstall::uninstall $ portname ${version_installed}_$revision_installed$oldvariant $optionslist} result]} {2161 ui_debug "Uninstalling $iname ${version_installed}_$revision_installed$oldvariant" 2162 if {[catch {portuninstall::uninstall $iname ${version_installed}_$revision_installed$oldvariant $optionslist} result]} { 2158 2163 global errorInfo 2159 2164 ui_debug "$errorInfo" 2160 ui_error "Uninstall $ portname ${version_installed}_$revision_installed$oldvariant failed: $result"2165 ui_error "Uninstall $iname ${version_installed}_$revision_installed$oldvariant failed: $result" 2161 2166 return 1 2162 2167 } 2163 2168 } else { 2164 2169 # XXX deactivate version_installed 2165 if {[catch {portimage::deactivate $ portname ${version_installed}_$revision_installed$oldvariant $optionslist} result]} {2170 if {[catch {portimage::deactivate $iname ${version_installed}_$revision_installed$oldvariant $optionslist} result]} { 2166 2171 global errorInfo 2167 2172 ui_debug "$errorInfo" 2168 ui_error "Deactivating $ portname ${version_installed}_$revision_installed failed: $result"2173 ui_error "Deactivating $iname ${version_installed}_$revision_installed failed: $result" 2169 2174 return 1 2170 2175 } -
trunk/base/src/port/port.tcl
r37316 r37349 210 210 set ilist [registry::installed $portname $portversion] 211 211 if { [llength $ilist] > 1 } { 212 # set portname again since the one we were passed may not have had the correct case 213 set portname [lindex [lindex $ilist 0] 0] 212 214 puts "The following versions of $portname are currently installed:" 213 215 foreach i [portlist_sortint $ilist] { … … 1500 1502 break_softcontinue "port location failed: $result" 1 status 1501 1503 } else { 1504 # set portname again since the one we were passed may not have had the correct case 1505 set portname [lindex $ilist 0] 1502 1506 set version [lindex $ilist 1] 1503 1507 set revision [lindex $ilist 2] … … 1684 1688 ui_debug "$errorInfo" 1685 1689 break_softcontinue "$result" 1 status 1690 } else { 1691 # set portname again since the one we were passed may not have had the correct case 1692 set portname [lindex [lindex $ilist 0] 0] 1686 1693 } 1687 1694 … … 1914 1921 } 1915 1922 foreachport $portlist { 1923 if { ![catch {set ilist [registry::installed $portname]} result] } { 1924 # set portname again since the one we were passed may not have had the correct case 1925 set portname [lindex [lindex $ilist 0] 0] 1926 } 1916 1927 set files [registry::port_registered $portname] 1917 1928 if { $files != 0 } { … … 1952 1963 array unset portinfo 1953 1964 array set portinfo [lindex $result 1] 1965 # set portname again since the one we were passed may not have had the correct case 1966 set portname $portinfo(name) 1954 1967 1955 1968 set depstypes {depends_build depends_lib depends_run} … … 2000 2013 array unset portinfo 2001 2014 array set portinfo [lindex $result 1] 2015 # set portname again since the one we were passed may not have had the correct case 2016 set portname $portinfo(name) 2002 2017 set porturl $portinfo(porturl) 2003 2018 set portdir $portinfo(portdir) -
trunk/base/src/registry1.0/portimage.tcl
r36501 r37349 80 80 } 81 81 82 if {$v != ""} {83 ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s @%s"] $name $v]"84 } else {85 ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s"] $name]"86 }87 88 82 set ilist [_check_registry $name $v] 83 # set name again since the one we were passed may not have had the correct case 84 set name [lindex $ilist 0] 89 85 set version [lindex $ilist 1] 90 86 set revision [lindex $ilist 2] 91 87 set variants [lindex $ilist 3] 88 89 if {$v != ""} { 90 ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s @%s"] $name $v]" 91 } else { 92 ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s"] $name]" 93 } 92 94 93 95 set ilist [registry::installed $name] … … 147 149 } 148 150 149 if {$v != ""} {150 ui_msg "$UI_PREFIX [format [msgcat::mc "Deactivating %s @%s"] $name $v]"151 } else {152 ui_msg "$UI_PREFIX [format [msgcat::mc "Deactivating %s"] $name]"153 }154 155 151 set ilist [registry::active $name] 156 152 if { [llength $ilist] > 1 } { … … 159 155 set ilist [lindex $ilist 0] 160 156 } 157 # set name again since the one we were passed may not have had the correct case 158 set name [lindex $ilist 0] 161 159 set version [lindex $ilist 1] 162 160 set revision [lindex $ilist 2] 163 161 set variants [lindex $ilist 3] 164 162 set fqversion ${version}_${revision}${variants} 163 164 if {$v != ""} { 165 ui_msg "$UI_PREFIX [format [msgcat::mc "Deactivating %s @%s"] $name $v]" 166 } else { 167 ui_msg "$UI_PREFIX [format [msgcat::mc "Deactivating %s"] $name]" 168 } 165 169 166 170 if { $v != "" && ![string equal ${fqversion} $v] } { … … 218 222 if { [string equal $v ""] } { 219 223 if { [llength $ilist] > 1 } { 224 # set name again since the one we were passed may not have had the correct case 225 set name [lindex [lindex $ilist 0] 0] 220 226 ui_msg "$UI_PREFIX [msgcat::mc "The following versions of $name are currently installed:"]" 221 227 foreach i $ilist { -
trunk/base/src/registry1.0/portuninstall.tcl
r36747 r37349 45 45 set ilist [registry::installed $portname $v] 46 46 if { [llength $ilist] > 1 } { 47 set portname [lindex [lindex $ilist 0] 0] 47 48 ui_msg "$UI_PREFIX [msgcat::mc "The following versions of $portname are currently installed:"]" 48 49 foreach i $ilist { … … 60 61 return -code error "Registry error: Please specify the full version as recorded in the port registry." 61 62 } else { 63 # set portname again since the one we were passed may not have had the correct case 64 set portname [lindex [lindex $ilist 0] 0] 62 65 set version [lindex [lindex $ilist 0] 1] 63 66 set revision [lindex [lindex $ilist 0] 2] -
trunk/base/src/registry1.0/receipt_flat.tcl
r36745 r37349 427 427 # [PG] Huh? 428 428 } else { 429 # We want to be case-insensitive but case-preserving, so the name gets 430 # returned with the correct case even if it's wrong when given. To get the 431 # correct case on a case-insensitive FS, we have to list the directory and 432 # compare against each entry. 433 set name_path [file join ${query_path} *] 434 set name_entries [glob -nocomplain -types d ${name_path}] 435 foreach entry $name_entries { 436 set basename [file tail $entry] 437 if {[string equal -nocase $basename $name]} { 438 set name $basename 439 break 440 } 441 } 429 442 set query_path [file join ${query_path} ${name}] 430 443 if { $version != "" } {

