Ticket #11759: case_fixes.diff
File case_fixes.diff, 13.4 KB (added by jmroot (Joshua Root), 16 years ago) |
---|
-
src/port/port.tcl
209 209 proc registry_installed {portname {portversion ""}} { 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] { 214 216 set iname [lindex $i 0] … … 1468 1470 ui_debug "$errorInfo" 1469 1471 break_softcontinue "port location failed: $result" 1 status 1470 1472 } else { 1473 # set portname again since the one we were passed may not have had the correct case 1474 set portname [lindex $ilist 0] 1471 1475 set version [lindex $ilist 1] 1472 1476 set revision [lindex $ilist 2] 1473 1477 set variants [lindex $ilist 3] … … 1652 1656 global errorInfo 1653 1657 ui_debug "$errorInfo" 1654 1658 break_softcontinue "$result" 1 status 1659 } else { 1660 # set portname again since the one we were passed may not have had the correct case 1661 set portname [lindex [lindex $ilist 0] 0] 1655 1662 } 1656 1663 1657 1664 set deplist [registry::list_dependents $portname] … … 1882 1889 return 1 1883 1890 } 1884 1891 foreachport $portlist { 1892 if { ![catch {set ilist [registry::installed $portname]} result] } { 1893 # set portname again since the one we were passed may not have had the correct case 1894 set portname [lindex [lindex $ilist 0] 0] 1895 } 1885 1896 set files [registry::port_registered $portname] 1886 1897 if { $files != 0 } { 1887 1898 if { [llength $files] > 0 } { … … 1920 1931 1921 1932 array unset portinfo 1922 1933 array set portinfo [lindex $result 1] 1934 # set portname again since the one we were passed may not have had the correct case 1935 set portname $portinfo(name) 1923 1936 1924 1937 set depstypes {depends_build depends_lib depends_run} 1925 1938 set depstypes_descr {"build" "library" "runtime"} … … 1968 1981 1969 1982 array unset portinfo 1970 1983 array set portinfo [lindex $result 1] 1984 # set portname again since the one we were passed may not have had the correct case 1985 set portname $portinfo(name) 1971 1986 set porturl $portinfo(porturl) 1972 1987 set portdir $portinfo(portdir) 1973 1988 -
src/registry1.0/portuninstall.tcl
44 44 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 { 49 50 set iname [lindex $i 0] … … 59 60 } 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] 64 67 set variants [lindex [lindex $ilist 0] 3] -
src/registry1.0/receipt_flat.tcl
426 426 } 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 != "" } { 431 444 set query_path [file join ${query_path} ${version}] -
src/registry1.0/portimage.tcl
79 79 set force 0 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] 94 96 if { [llength $ilist] > 1 } { … … 146 148 set force 0 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 } { 157 153 return -code error "Registry error: Please specify the name of the port." 158 154 } else { 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} 165 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 } 169 166 170 if { $v != "" && ![string equal ${fqversion} $v] } { 167 171 return -code error "Active version of $name is not $v but ${fqversion}." 168 172 } … … 217 221 set ilist [registry::installed $name $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 { 222 228 set iname [lindex $i 0] -
src/macports1.0/macports.tcl
1893 1893 } 1894 1894 # fill array with information 1895 1895 array set portinfo [lindex $result 1] 1896 # set portname again since the one we were passed may not have had the correct case 1897 set portname $portinfo(name) 1896 1898 1897 1899 # set version_in_tree and revision_in_tree 1898 1900 if {![info exists portinfo(version)]} { … … 1951 1953 # XXX this sets $version_installed to $version_in_tree even if not installed!! 1952 1954 set version_installed $version_in_tree 1953 1955 set revision_installed $revision_in_tree 1956 set iname $portname 1954 1957 # That was a very dirty hack showing how ugly our depencendy and upgrade code is. 1955 1958 # To get it working when user provides -f, we also need to set the variant to 1956 1959 # avoid a future failure. … … 1968 1971 [rpm-vercomp $version $version_installed] > 0 1969 1972 || ([rpm-vercomp $version $version_installed] == 0 1970 1973 && [rpm-vercomp $revision $revision_installed] > 0)} { 1974 set iname [lindex $i 0] 1971 1975 set version_installed $version 1972 1976 set revision_installed $revision 1973 1977 set variant_installed $variant 1974 set epoch_installed [registry::property_retrieve [registry::open_entry $ portname [lindex $i 1] [lindex $i 2] $variant] epoch]1978 set epoch_installed [registry::property_retrieve [registry::open_entry $iname [lindex $i 1] [lindex $i 2] $variant] epoch] 1975 1979 set num $i 1976 1980 } 1977 1981 1978 1982 set isactive [lindex $i 4] 1979 1983 if {$isactive == 1} { 1980 1984 set anyactive yes 1985 set active_name [lindex $i 0] 1981 1986 set version_active $version 1982 1987 set revision_active $revision 1983 1988 set variant_active $variant … … 1987 1992 || [rpm-vercomp $revision_installed $revision_active] != 0 1988 1993 || [string compare $variant_installed $variant_active] != 0)} { 1989 1994 # deactivate version 1990 if {[catch {portimage::deactivate $ portname ${version_active}_${revision_active}${variant_active} $optionslist} result]} {1995 if {[catch {portimage::deactivate $active_name ${version_active}_${revision_active}${variant_active} $optionslist} result]} { 1991 1996 global errorInfo 1992 1997 ui_debug "$errorInfo" 1993 ui_error "Deactivating $ portname @${version_active}_${revision_active} failed: $result"1998 ui_error "Deactivating $active_name @${version_active}_${revision_active} failed: $result" 1994 1999 return 1 1995 2000 } 1996 2001 } 1997 2002 if { [lindex $num 4] == 0 && 0 == [string compare "image" ${macports::registry.installtype}] } { 1998 2003 # activate the latest installed version 1999 if {[catch {portimage::activate $ portname ${version_installed}_${revision_installed}$variant $optionslist} result]} {2004 if {[catch {portimage::activate $iname ${version_installed}_${revision_installed}$variant $optionslist} result]} { 2000 2005 global errorInfo 2001 2006 ui_debug "$errorInfo" 2002 ui_error "Activating $ portname @${version_installed}_${revision_installed} failed: $result"2007 ui_error "Activating $iname @${version_installed}_${revision_installed} failed: $result" 2003 2008 return 1 2004 2009 } 2005 2010 } … … 2008 2013 # output version numbers 2009 2014 ui_debug "epoch: in tree: $epoch_in_tree installed: $epoch_installed" 2010 2015 ui_debug "$portname ${version_in_tree}_$revision_in_tree exists in the ports tree" 2011 ui_debug "$ portname ${version_installed}_$revision_installed is installed"2016 ui_debug "$iname ${version_installed}_$revision_installed is installed" 2012 2017 2013 2018 # set the nodeps option 2014 2019 if {![info exists options(ports_nodeps)]} { … … 2075 2080 || ([rpm-vercomp $version_installed $version_in_tree] == 0 2076 2081 && [rpm-vercomp $revision_installed $revision_in_tree] >= 0 )) 2077 2082 && ![info exists options(ports_force)] } { 2078 ui_debug "No need to upgrade! $ portname ${version_installed}_$revision_installed >= $portname ${version_in_tree}_$revision_in_tree"2083 ui_debug "No need to upgrade! $iname ${version_installed}_$revision_installed >= $portname ${version_in_tree}_$revision_in_tree" 2079 2084 if { $epoch_installed >= $epoch_in_tree } { 2080 2085 # Check if we have to do dependents 2081 2086 if {[info exists options(ports_do_dependents)]} { … … 2083 2088 set options(ports_nodeps) 1 2084 2089 2085 2090 registry::open_dep_map 2086 set deplist [registry::list_dependents $ portname]2091 set deplist [registry::list_dependents $iname] 2087 2092 2088 2093 if { [llength deplist] > 0 } { 2089 2094 foreach dep $deplist { … … 2152 2157 # uninstall old ports 2153 2158 if {[info exists options(port_uninstall_old)] || $epoch_override == 1 || [info exists options(ports_force)] || 0 != [string compare "image" ${macports::registry.installtype}] } { 2154 2159 # uninstall old 2155 ui_debug "Uninstalling $ portname ${version_installed}_$revision_installed$oldvariant"2156 if {[catch {portuninstall::uninstall $ portname ${version_installed}_$revision_installed$oldvariant $optionslist} result]} {2160 ui_debug "Uninstalling $iname ${version_installed}_$revision_installed$oldvariant" 2161 if {[catch {portuninstall::uninstall $iname ${version_installed}_$revision_installed$oldvariant $optionslist} result]} { 2157 2162 global errorInfo 2158 2163 ui_debug "$errorInfo" 2159 ui_error "Uninstall $ portname ${version_installed}_$revision_installed$oldvariant failed: $result"2164 ui_error "Uninstall $iname ${version_installed}_$revision_installed$oldvariant failed: $result" 2160 2165 return 1 2161 2166 } 2162 2167 } else { 2163 2168 # XXX deactivate version_installed 2164 if {[catch {portimage::deactivate $ portname ${version_installed}_$revision_installed$oldvariant $optionslist} result]} {2169 if {[catch {portimage::deactivate $iname ${version_installed}_$revision_installed$oldvariant $optionslist} result]} { 2165 2170 global errorInfo 2166 2171 ui_debug "$errorInfo" 2167 ui_error "Deactivating $ portname ${version_installed}_$revision_installed failed: $result"2172 ui_error "Deactivating $iname ${version_installed}_$revision_installed failed: $result" 2168 2173 return 1 2169 2174 } 2170 2175 }