Changeset 14766 for trunk/base


Ignore:
Timestamp:
Oct 22, 2005, 2:40:20 PM (15 years ago)
Author:
jberry
Message:
  • Remove option -U url. This had previously been -u url, which collided with the -u option for upgrade. Since it probably didn't work anyway, I've decided to remove the option completely, as it now makes more sense to simply specify the url like this: "port info file:///path/to/my/port". This allows us to get rid of the global_porturl, which was a bit of a hack anyway.
  • Change option "-D path" to actually set the directory as it was intended. This would be a way to specify a single current port by directory. You could say, for instance: "port -D /path/to/my/port info". If you were naming multiple ports, you could use the pseudo port "current" in conjunction with this.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port/port.tcl

    r14736 r14766  
    33exec @TCLSH@ "$0" "$@"
    44# port.tcl
    5 # $Id: port.tcl,v 1.137 2005/10/20 21:26:43 jberry Exp $
     5# $Id: port.tcl,v 1.138 2005/10/22 14:40:20 jberry Exp $
    66#
    77# Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org>
     
    139139proc print_usage args {
    140140        global cmdname
    141         set usage { [-vdqfonasbckt] [-D portdir] [-u porturl] action [actionflags]
     141        set usage { [-vdqfonasbckt] [-D portdir] action [actionflags]
    142142[[portname|pseudo-portname|port-url] [version] [+-variant]... [option=value]...]...
    143143}
     
    151151        global cmdname
    152152       
    153         set help { [-vdqfonasbckt] [-D portdir] [-u porturl] action [actionflags]
     153        set help { [-vdqfonasbckt] [-D portdir] action [actionflags]
    154154[[portname|pseudo-portname|port-url] [version] [+-variant]... [option=value]...]...
    155155       
     
    303303        # If neither portname nor url is specified, then default to the current port
    304304        if { $port(url) == "" && $port(name) == "" } {
    305                 if {[info exists global_porturl]} {
    306                         set url $global_porturl
    307                 } else {
    308                         set url file://.
    309                 }
     305                set url file://.
    310306                set portname [url_to_portname $url]
    311307                set port(url) $url
     
    361357proc require_portlist {} {
    362358        upvar portlist portlist
    363         global global_porturl
    364359       
    365360        if {[llength $portlist] == 0} {
    366                 if {[info exists global_porturl]} {
    367                         set url $global_porturl
    368                 } else {
    369                         set url file://.
    370                 }
    371                 set portname [url_to_portname $url]
    372        
    373                 if {$portname != ""} {
    374                         add_to_portlist portlist [list url $url name $portname]
    375                 } else {
    376                         fatal "You must specify a port or be in a port directory"
    377                 }
     361                set portlist [get_current_port]
    378362        }
    379363}
     
    464448
    465449proc get_current_port {} {
    466         global global_porturl
    467 
    468         if {[info exists global_porturl]} {
    469                 set url $global_porturl
    470         } else {
    471                 set url file://.
    472         }
     450        set url file://.
    473451        set portname [url_to_portname $url]
    474452        if {$portname == ""} {
    475                 fatal "The pseudo-port current must be issued in a port's directory"
     453                fatal "To use the current port, you must in a port's directory"
    476454        }
    477455       
     
    11121090                                t { set global_options(ports_trace) yes                 }
    11131091                                D { advance
    1114                                         set global_porturl "file://[lookahead]"
    1115                                         break
    1116                                   }
    1117                                 U { advance
    1118                                         set global_porturl [lookahead]
     1092                                        cd [lookahead]
    11191093                                        break
    11201094                                  }
Note: See TracChangeset for help on using the changeset viewer.