Ticket #10827: upgrade-dependents-fix.diff

File upgrade-dependents-fix.diff, 3.7 KB (added by jmroot (Joshua Root), 16 years ago)

turn off -R while upgrading dependencies, and use the dep cache for dependents too

  • src/macports1.0/macports.tcl

     
    20212021        ui_debug "Not following dependencies"
    20222022        set depflag 0
    20232023    } else {
     2024        # If we're following dependents, we only want to follow this port's
     2025        # dependents, not those of all its dependencies. Otherwise, we would
     2026        # end up processing this port's dependents n+1 times (recursively!),
     2027        # where n is the number of dependencies this port has, since this port
     2028        # is of course a dependent of each of its dependencies. Plus the
     2029        # dependencies could have any number of unrelated dependents.
     2030       
     2031        # So we save whether we're following dependents, unset the option
     2032        # while doing the dependencies, and restore it afterwards.
     2033        set saved_do_dependents [info exists options(ports_do_dependents)]
     2034        unset -nocomplain options(ports_do_dependents)
     2035       
    20242036        # build depends is upgraded
    20252037        if {[info exists portinfo(depends_build)]} {
    20262038            foreach i $portinfo(depends_build) {
    20272039                if {![llength [array get depscache $i]]} {
    20282040                set d [lindex [split $i :] end]
    20292041                    set depscache($i) 1
    2030                     upgrade $d $i $variationslist $optionslist depscache
     2042                    upgrade $d $i $variationslist [array get options] depscache
    20312043                }
    20322044            }
    20332045        }
     
    20372049                if {![llength [array get depscache $i]]} {
    20382050                set d [lindex [split $i :] end]
    20392051                    set depscache($i) 1
    2040                     upgrade $d $i $variationslist $optionslist depscache
     2052                    upgrade $d $i $variationslist [array get options] depscache
    20412053                }
    20422054            }
    20432055        }
     
    20472059                if {![llength [array get depscache $i]]} {
    20482060                set d [lindex [split $i :] end]
    20492061                    set depscache($i) 1
    2050                     upgrade $d $i $variationslist $optionslist depscache
     2062                    upgrade $d $i $variationslist [array get options] depscache
    20512063                }
    20522064            }
    20532065        }
     2066       
     2067        # restore dependent-following to its former value
     2068        if {$saved_do_dependents} {
     2069            set options(ports_do_dependents) yes
     2070        }
    20542071    }
    20552072
    20562073    # check installed version against version in ports
     
    20702087
    20712088                if { [llength deplist] > 0 } {
    20722089                    foreach dep $deplist {
    2073                         set mpname [lindex $dep 2]
    2074                         macports::upgrade $mpname "port:$mpname" [array get variations] [array get options]
     2090                        set mpname [lindex $dep 2]
     2091                        if {![llength [array get depscache port:${mpname}]]} {
     2092                            set depscache(port:${mpname}) 1
     2093                            macports::upgrade $mpname port:${mpname} [array get variations] [array get options] depscache
     2094                        }
    20752095                    }
    20762096                }
    20772097            }
     
    21662186
    21672187        if { [llength deplist] > 0 } {
    21682188            foreach dep $deplist {
    2169                 set mpname [lindex $dep 2]
    2170                 macports::upgrade $mpname "port:$mpname" [array get variations] [array get options]
     2189                set mpname [lindex $dep 2]
     2190                if {![llength [array get depscache port:${mpname}]]} {
     2191                    set depscache(port:${mpname}) 1
     2192                    macports::upgrade $mpname port:${mpname} [array get variations] [array get options] depscache
     2193                }
    21712194            }
    21722195        }
    21732196    }