Changeset 83271
- Timestamp:
- 08/29/11 06:58:53 (4 years ago)
- File:
-
- 1 edited
-
trunk/base/src/macports1.0/macports.tcl (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/base/src/macports1.0/macports.tcl
r83270 r83271 1939 1939 global macports::autoconf::rsync_path macports::autoconf::tar_path macports::autoconf::openssl_path 1940 1940 array set options $optionslist 1941 if {[info exists options(no_reindex)]} { 1942 upvar $options(needed_portindex_var) any_needed_portindex 1943 } 1941 1944 1942 1945 set numfailed 0 … … 2066 2069 } 2067 2070 2071 set needs_portindex 1 2068 2072 # now sync the index if the local file is missing or older than a day 2069 if {![file isfile $indexfile] || [expr [clock seconds] - [file mtime $indexfile]] > 86400} { 2073 if {![file isfile $indexfile] || [expr [clock seconds] - [file mtime $indexfile]] > 86400 2074 || [info exists options(no_reindex)]} { 2070 2075 if {$is_tarball} { 2071 2076 # chop ports.tar off the end … … 2081 2086 } else { 2082 2087 set ok 1 2088 set needs_portindex 0 2083 2089 if {$is_tarball} { 2084 2090 set ok 0 2091 set needs_portindex 1 2085 2092 # verify signature for PortIndex 2086 2093 set rsync_commandline "${macports::autoconf::rsync_path} ${rsync_options} ${remote_indexfile}.rmd160 ${destdir}" … … 2090 2097 if {![catch {exec $openssl dgst -ripemd160 -verify $pubkey -signature ${destdir}/PortIndex.rmd160 ${destdir}/PortIndex} result]} { 2091 2098 set ok 1 2099 set needs_portindex 0 2092 2100 ui_debug "successful verification with key $pubkey" 2093 2101 break … … 2111 2119 ui_warn "Setting world read permissions on parts of the ports tree failed, need root?" 2112 2120 } 2113 set needs_portindex 12114 2121 } 2115 2122 {^https?$|^ftp$} { … … 2173 2180 2174 2181 file delete $tarpath 2175 2176 set needs_portindex 12177 2182 } else { 2178 2183 # sync just a PortIndex file … … 2189 2194 2190 2195 if {$needs_portindex} { 2191 global macports::prefix 2192 set indexdir [file dirname [macports::getindex $source]] 2193 if {[catch {system "${macports::prefix}/bin/portindex $indexdir"}]} { 2194 ui_error "updating PortIndex for $source failed" 2196 set any_needed_portindex 1 2197 if {![info exists options(no_reindex)]} { 2198 global macports::prefix 2199 set indexdir [file dirname [macports::getindex $source]] 2200 if {[catch {system "${macports::prefix}/bin/portindex $indexdir"}]} { 2201 ui_error "updating PortIndex for $source failed" 2202 } 2195 2203 } 2196 2204 } … … 2936 2944 } 2937 2945 2938 # syncing ports tree.2939 if {![info exists options(ports_selfupdate_nosync)] || $options(ports_selfupdate_nosync) != "yes"} {2940 ui_msg "---> Updating the ports tree"2941 if {[catch {mportsync $optionslist} result]} {2942 return -code error "Couldn't sync the ports tree: $result"2943 }2944 }2945 2946 2946 # are we syncing a tarball? (implies detached signature) 2947 2947 set is_tarball 0 … … 3032 3032 # check if we we need to rebuild base 3033 3033 set comp [vercmp $macports_version_new $macports::autoconf::macports_version] 3034 3035 # syncing ports tree. 3036 if {![info exists options(ports_selfupdate_nosync)] || $options(ports_selfupdate_nosync) != "yes"} { 3037 ui_msg "---> Updating the ports tree" 3038 if {$comp > 0} { 3039 # updated portfiles potentially need new base to parse - tell sync to try to 3040 # use prefabricated PortIndex files and signal if it couldn't 3041 lappend optionslist no_reindex 1 needed_portindex_var needed_portindex 3042 } 3043 if {[catch {mportsync $optionslist} result]} { 3044 return -code error "Couldn't sync the ports tree: $result" 3045 } 3046 } 3047 3034 3048 if {$use_the_force_luke == "yes" || $comp > 0} { 3035 3049 if {[info exists options(ports_dryrun)] && $options(ports_dryrun) == "yes"} { … … 3099 3113 3100 3114 if {![info exists options(ports_selfupdate_nosync)] || $options(ports_selfupdate_nosync) != "yes"} { 3101 ui_msg "\nThe ports tree has been updated. To upgrade your installed ports, you should run" 3102 ui_msg " port upgrade outdated" 3115 if {[info exists needed_portindex]} { 3116 ui_msg "Not all sources could be fully synced using the old version of MacPorts." 3117 ui_msg "Please run selfupdate again now that MacPorts base has been updated." 3118 } else { 3119 ui_msg "\nThe ports tree has been updated. To upgrade your installed ports, you should run" 3120 ui_msg " port upgrade outdated" 3121 } 3103 3122 } 3104 3123
Note: See TracChangeset
for help on using the changeset viewer.

