Ignore:
Timestamp:
Jan 5, 2006, 6:40:56 AM (15 years ago)
Author:
olegb
Message:

Bug:
Submitted by:
Reviewed by:
Approved by:
Obtained from:

Add

  • New target: "dependents"
  • New switch: "-R" for upgrading dependents
  • Make upgrade look up force for forcefully upgrading (or re-installing)
  • Documenting the above in port.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/darwinports1.0/darwinports.tcl

    r15657 r15691  
    11# darwinports.tcl
    2 # $Id: darwinports.tcl,v 1.202 2005/12/31 04:48:05 jberry Exp $
     2# $Id: darwinports.tcl,v 1.203 2006/01/05 06:40:56 olegb Exp $
    33#
    44# Copyright (c) 2002 Apple Computer, Inc.
    55# Copyright (c) 2004 - 2005 Paul Guyot, <pguyot@kallisys.net>.
    6 # Copyright (c) 2004 Ole Guldberg Jensen <olegb@opendarwin.org>.
     6# Copyright (c) 2004 - 2006 Ole Guldberg Jensen <olegb@opendarwin.org>.
    77# Copyright (c) 2004 - 2005 Robert Shaw <rshaw@opendarwin.org>
    88# All rights reserved.
     
    16061606
    16071607        # check installed version against version in ports
    1608         if { [rpm-vercomp $version_installed $version_in_tree] >= 0 } {
     1608        if { [rpm-vercomp $version_installed $version_in_tree] >= 0 && ![info exists options(ports_force)] } {
    16091609                ui_debug "No need to upgrade! $portname $version_installed >= $portname $version_in_tree"
    16101610                if { $epoch_installed >= $epoch_in_tree } {
     1611                        # Check if we have to do dependents
     1612                        if {[info exists options(ports_do_dependents)]} {
     1613                                # We do dependents ..
     1614                                set options(ports_nodeps) 1
     1615
     1616                                registry::open_dep_map
     1617                                set deplist [registry::list_dependents $portname]
     1618
     1619                                if { [llength deplist] > 0 } {
     1620                                        foreach dep $deplist {
     1621                                                set dpname [lindex $dep 2]
     1622                                                darwinports::upgrade $dpname "port:$dpname" [array get variations] [array get options]
     1623                                        }
     1624                                }
     1625                        }
     1626
    16111627                        return 0
    16121628                } else {
     
    16571673
    16581674        # uninstall old ports
    1659         if {[info exists options(port_uninstall_old)] || $epoch_override == 1} {
    1660                 # uninstalll old
     1675        if {[info exists options(port_uninstall_old)] || $epoch_override == 1 || [info exists options(ports_force)] } {
     1676                # uninstall old
    16611677                ui_debug "Uninstalling $portname $version_installed$oldvariant"
    16621678                if {[catch {portuninstall::uninstall $portname $version_installed$oldvariant $optionslist} result]} {
     
    16821698                return 1
    16831699        }
     1700
     1701        # Check if we have to do dependents
     1702        if {[info exists options(ports_do_dependents)]} {
     1703                # We do dependents ..
     1704                set options(ports_nodeps) 1
     1705
     1706                registry::open_dep_map
     1707                set deplist [registry::list_dependents $portname]
     1708
     1709                if { [llength deplist] > 0 } {
     1710                        foreach dep $deplist {
     1711                                set dpname [lindex $dep 2]
     1712                                darwinports::upgrade $dpname "port:$dpname" [array get variations] [array get options]
     1713                        }
     1714                }
     1715        }
     1716
    16841717       
    16851718        # close the port handle
Note: See TracChangeset for help on using the changeset viewer.