Changeset 15691 for trunk/base


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
Location:
trunk/base/src
Files:
3 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
  • trunk/base/src/port/port.1

    r15665 r15691  
    3737.Sh SYNOPSIS
    3838.Nm
    39 .Op Fl vdqfonusbckt
     39.Op Fl vdqfonRusbckt
    4040.Op Fl D Ar portdir
    4141.Ar action
     
    201201.It Fl n
    202202dont follow dependencies in upgrade (only for upgrading)
     203.It Fl R
     204also upgrade dependents (only for upgrading)
    203205.It Fl u
    204206uninstall non-active ports when upgrading and uninstalling
     
    237239Lists the other ports that are required to build and run
    238240.Ar portname .
     241.Ss dependents
     242Lists the ports that depend on the port
     243.Ar portname .
    239244.Ss install
    240245Install and activate
     
    286291.Pp
    287292.Dl "port upgrade installed"
     293.Pp
     294To upgrade
     295.Ar portname
     296and the ports that depend on it:
     297.Pp
     298.Dl "port -R upgrade libiconv"
     299.Pp
     300To force an upgrade (rebuild) use:
     301.Pp
     302.Dl "port -f upgrade vim"
    288303.Pp
    289304To upgrade
  • trunk/base/src/port/port.tcl

    r15665 r15691  
    33exec @TCLSH@ "$0" "$@"
    44# port.tcl
    5 # $Id: port.tcl,v 1.145 2006/01/01 15:24:48 olegb Exp $
     5# $Id: port.tcl,v 1.146 2006/01/05 06:40:56 olegb Exp $
    66#
    77# Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org>
     
    139139proc print_usage args {
    140140        global cmdname
    141         set usage { [-vdqfonsbcktu] [-D portdir] action [actionflags]
     141        set usage { [-vdqfonRsbcktu] [-D portdir] action [actionflags]
    142142[[portname|pseudo-portname|port-url] [@version] [+-variant]... [option=value]...]...
    143143}
     
    151151        global cmdname
    152152       
    153         set help { [-vdqfonsbcktu] [-D portdir] action [actionflags]
     153        set help { [-vdqfonRsbcktu] [-D portdir] action [actionflags]
    154154[[portname|pseudo-portname|port-url] [@version] [+-variant]... [option=value]...]...
    155155       
     
    157157        help, info, location, provides, activate, deactivate, selfupdate, upgrade,
    158158        version, compact, uncompact, uninstall, installed, outdated, contents, deps,
    159         variants, search, list, echo, sync, dir, url, file, cat, edit,
     159        dependents, variants, search, list, echo, sync, dir, url, file, cat, edit,
    160160        fetch, patch, extract, build, destroot, install, test.
    161161       
     
    11181118                                o { set global_options(ports_ignore_older) yes  }
    11191119                                n { set global_options(ports_nodeps) yes                }
     1120                                R { set global_options(ports_do_dependents) yes }
    11201121                                u { set global_options(port_uninstall_old) yes  }
    11211122                                s { set global_options(ports_source_only) yes   }
     
    13481349                }
    13491350        }
    1350        
     1351
     1352        dependents {
     1353                require_portlist
     1354
     1355                foreachport $portlist {
     1356                        registry::open_dep_map
     1357                set deplist [registry::list_dependents $portname]
     1358
     1359                if { [llength $deplist] > 0 } {
     1360                        set dl [list]
     1361                        # Check the deps first
     1362                        foreach dep $deplist {
     1363                                set depport [lindex $dep 2]
     1364                                ui_msg "$depport depends on $portname"
     1365                                # xxx: Should look at making registry::installed return 0 or
     1366                                # something instead  of erroring.
     1367                                if { ![catch {set installed [registry::installed $depport]} res] } {
     1368                                        if { [llength [registry::installed $depport]] > 0 } {
     1369                                                lappend dl $depport
     1370                                        }
     1371                                        }
     1372                                }
     1373                } else {
     1374                                ui_msg "$portname has no dependents!"
     1375                        }
     1376                }
     1377        }
     1378
    13511379        upgrade {
    13521380        # Otherwise if the user has supplied no ports we'll use the current port
Note: See TracChangeset for help on using the changeset viewer.