Ticket #11892: dry.4.patch

File dry.4.patch, 4.0 KB (added by gwhitneycom1@…, 18 years ago)

update patch to r25303

  • src/port/port.1

     
    235235In batch and interactive mode, exit on the first error encountered. Otherwise, errors during batch execution are simply reported.
    236236.It Fl p
    237237Despite any errors encountered, proceed to process multiple ports and commands.
     238.It Fl y
     239Perform a dry run. All of the steps to build the ports and their dependencies are computed, but not actually performed. With the verbose flag, every step is reported; otherwise there is just one message per port, which allows you to easily determine the recursive deps of a port (and the order in which they will be built).
    238240.It Fl t
    239241enable trace mode debug facilities on platforms that support it (MacOS X). This feature is two-folded. It consists in automatically detecting and reporting undeclared dependencies based on what files the port reads or what programs the port executes. In verbose mode, it will also report unused dependencies for each stage of the port installation. It also consists in forbidding and reporting file creation and file writes outside allowed directories (temporary directories and ${workpath}).
    240242.El
  • src/port/port.tcl

     
    136136        global cmdname
    137137        global action_array
    138138       
    139         set syntax { [-bcdfiknopqRstuvx] [-D portdir] [-F cmdfile] action [privopts] [actionflags]
     139        set syntax { [-bcdfiknopqRstuvxy] [-D portdir] [-F cmdfile] action [privopts] [actionflags]
    140140[[portname|pseudo-portname|port-url] [@version] [+-variant]... [option=value]...]...
    141141}
    142142
     
    22732273                                        c { set global_options(ports_autoclean) yes             }
    22742274                                        k { set global_options(ports_autoclean) no              }
    22752275                                        t { set global_options(ports_trace) yes                 }
     2276                                        y { set global_options(ports_dryrun) yes                }
    22762277                                        F { # Name a command file to process
    22772278                                                advance
    22782279                                                if {[moreargs]} {
  • src/port1.0/portutil.tcl

     
    10061006}
    10071007
    10081008########### Internal Dependency Manipulation Procedures ###########
     1009global ports_dry_last_skipped
     1010set ports_dry_last_skipped ""
    10091011
    10101012proc target_run {ditem} {
    1011     global target_state_fd portpath portname portversion portrevision portvariants ports_force variations workpath ports_trace PortInfo
     1013    global target_state_fd portpath portname portversion portrevision portvariants ports_force variations workpath ports_trace PortInfo ports_dryrun ports_dry_last_skipped
    10121014    set result 0
    10131015    set skipped 0
    10141016    set procedure [ditem_key $ditem procedure]
     
    10771079                        }
    10781080                       
    10791081                }
     1082
     1083                # Of course, if this is a dry run, don't do the task:
     1084                if {[info exists ports_dryrun] && $ports_dryrun == "yes"} {
     1085                    # only one message per portname
     1086                    if {$portname != $ports_dry_last_skipped} {
     1087                            ui_msg "For $portname: skipping $name (dry run)"
     1088                            set ports_dry_last_skipped $portname
     1089                    } else {
     1090                        ui_info "    .. and skipping $name"
     1091                    }
     1092                    set skipped 1
     1093                }
    10801094                       
    10811095                # otherwise execute the task.
    10821096                if {$skipped == 0} {
     
    14321446}
    14331447
    14341448proc check_variants {variations target} {
    1435     global ports_force PortInfo
     1449    global ports_force ports_dryrun PortInfo
    14361450    upvar $variations upvariations
    14371451    set result 0
    14381452    set portname $PortInfo(name)
     
    14521466                if {[check_statefile_variants upvariations $state_fd]} {
    14531467                        ui_error "Requested variants do not match original selection.\nPlease perform 'port clean $portname' or specify the force option."
    14541468                        set result 1
    1455                 } else {
     1469                } elseif {!([info exists ports_dryrun]
     1470                            && $ports_dryrun == "yes")} {
    14561471                        # Write variations out to the statefile
    14571472                        foreach key [array names upvariations *] {
    14581473                        write_statefile variant $upvariations($key)$key $state_fd