New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 83271


Ignore:
Timestamp:
08/29/11 06:58:53 (4 years ago)
Author:
jmr@…
Message:

don't regenerate PortIndex locally during selfupdate when base is outdated, and tell user to selfupdate again if that means there are sources without a current index (#30739)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/macports1.0/macports.tcl

    r83270 r83271  
    19391939    global macports::autoconf::rsync_path macports::autoconf::tar_path macports::autoconf::openssl_path 
    19401940    array set options $optionslist 
     1941    if {[info exists options(no_reindex)]} { 
     1942        upvar $options(needed_portindex_var) any_needed_portindex 
     1943    } 
    19411944 
    19421945    set numfailed 0 
     
    20662069                } 
    20672070 
     2071                set needs_portindex 1 
    20682072                # 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)]} { 
    20702075                    if {$is_tarball} { 
    20712076                        # chop ports.tar off the end 
     
    20812086                    } else { 
    20822087                        set ok 1 
     2088                        set needs_portindex 0 
    20832089                        if {$is_tarball} { 
    20842090                            set ok 0 
     2091                            set needs_portindex 1 
    20852092                            # verify signature for PortIndex 
    20862093                            set rsync_commandline "${macports::autoconf::rsync_path} ${rsync_options} ${remote_indexfile}.rmd160 ${destdir}" 
     
    20902097                                    if {![catch {exec $openssl dgst -ripemd160 -verify $pubkey -signature ${destdir}/PortIndex.rmd160 ${destdir}/PortIndex} result]} { 
    20912098                                        set ok 1 
     2099                                        set needs_portindex 0 
    20922100                                        ui_debug "successful verification with key $pubkey" 
    20932101                                        break 
     
    21112119                    ui_warn "Setting world read permissions on parts of the ports tree failed, need root?" 
    21122120                } 
    2113                 set needs_portindex 1 
    21142121            } 
    21152122            {^https?$|^ftp$} { 
     
    21732180 
    21742181                    file delete $tarpath 
    2175                      
    2176                     set needs_portindex 1 
    21772182                } else { 
    21782183                    # sync just a PortIndex file 
     
    21892194         
    21902195        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                } 
    21952203            } 
    21962204        } 
     
    29362944    } 
    29372945 
    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  
    29462946    # are we syncing a tarball? (implies detached signature) 
    29472947    set is_tarball 0 
     
    30323032    # check if we we need to rebuild base 
    30333033    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 
    30343048    if {$use_the_force_luke == "yes" || $comp > 0} { 
    30353049        if {[info exists options(ports_dryrun)] && $options(ports_dryrun) == "yes"} { 
     
    30993113 
    31003114    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        } 
    31033122    } 
    31043123 
Note: See TracChangeset for help on using the changeset viewer.