Ticket #11892: dry.5.patch
File dry.5.patch, 7.5 KB (added by gwhitneycom1@…, 17 years ago) |
---|
-
src/port/port.1
235 235 In batch and interactive mode, exit on the first error encountered. Otherwise, errors during batch execution are simply reported. 236 236 .It Fl p 237 237 Despite any errors encountered, proceed to process multiple ports and commands. 238 .It Fl y 239 Perform 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). 238 240 .It Fl t 239 241 enable 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}). 240 242 .El -
src/port/port.tcl
136 136 global cmdname 137 137 global action_array 138 138 139 set syntax { [-bcdfiknopqRstuvx ] [-D portdir] [-F cmdfile] action [privopts] [actionflags]139 set syntax { [-bcdfiknopqRstuvxy] [-D portdir] [-F cmdfile] action [privopts] [actionflags] 140 140 [[portname|pseudo-portname|port-url] [@version] [+-variant]... [option=value]...]... 141 141 } 142 142 … … 2279 2279 c { set global_options(ports_autoclean) yes } 2280 2280 k { set global_options(ports_autoclean) no } 2281 2281 t { set global_options(ports_trace) yes } 2282 y { set global_options(ports_dryrun) yes } 2282 2283 F { # Name a command file to process 2283 2284 advance 2284 2285 if {[moreargs]} { -
src/darwinports1.0/darwinports.tcl
1615 1615 if {![string match "" $depscachename]} { 1616 1616 upvar $depscachename depscache 1617 1617 } 1618 1618 1619 1619 # set to no-zero is epoch overrides version 1620 1620 set epoch_override 0 1621 # Is this a dry run? 1622 set is_dryrun "no" 1623 if {[info exists options(ports_dryrun)] && $options(ports_dryrun) eq "yes"} { 1624 set is_dryrun "yes" 1625 } 1621 1626 1622 1627 # check if the port is in tree 1623 1628 if {[catch {dportsearch $portname false exact} result]} { … … 1709 1714 set isactive [lindex $i 4] 1710 1715 if {$isactive == 1 && [rpm-vercomp $version_installed $version] < 0 } { 1711 1716 # deactivate version 1712 if {[catch {portimage::deactivate $portname $version $optionslist} result]} { 1717 if {$is_dryrun eq "yes"} { 1718 ui_msg "Skipping deactivate $portname $version (dry run)" 1719 } elseif {[catch {portimage::deactivate $portname $version $optionslist} result]} { 1713 1720 global errorInfo 1714 1721 ui_debug "$errorInfo" 1715 1716 1717 1722 ui_error "Deactivating $portname $version_installed failed: $result" 1723 return 1 1724 } 1718 1725 } 1719 1726 } 1720 1727 if { [lindex $num 4] == 0 && 0 == [string compare "image" ${darwinports::registry.installtype}] } { 1721 1728 # activate the latest installed version 1722 if {[catch {portimage::activate $portname $version_installed$variant $optionslist} result]} { 1729 if {$is_dryrun eq "yes"} { 1730 ui_msg "Skipping activate $portname $version_installed (dry run)" 1731 } elseif {[catch {portimage::activate $portname $version_installed$variant $optionslist} result]} { 1723 1732 global errorInfo 1724 1733 ui_debug "$errorInfo" 1725 1734 ui_error "Activating $portname $version_installed failed: $result" 1726 1735 return 1 1727 1736 } 1728 1737 } … … 1853 1862 if {[info exists options(port_uninstall_old)] || $epoch_override == 1 || [info exists options(ports_force)] || 0 != [string compare "image" ${darwinports::registry.installtype}] } { 1854 1863 # uninstall old 1855 1864 ui_debug "Uninstalling $portname $version_installed$oldvariant" 1856 if {[catch {portuninstall::uninstall $portname $version_installed$oldvariant $optionslist} result]} { 1865 if {$is_dryrun eq "yes"} { 1866 ui_msg "Skipping uninstall $portname $version_installed (dry run)" 1867 } elseif {[catch {portuninstall::uninstall $portname $version_installed$oldvariant $optionslist} result]} { 1857 1868 global errorInfo 1858 1869 ui_debug "$errorInfo" 1859 1860 1861 1870 ui_error "Uninstall $portname $version_installed$oldvariant failed: $result" 1871 return 1 1872 } 1862 1873 } else { 1863 1874 # XXX deactivate version_installed 1864 if {[catch {portimage::deactivate $portname $version_installed$oldvariant $optionslist} result]} { 1875 if {$is_dryrun eq "yes"} { 1876 ui_msg "Skipping deactivate $portname $version_installed (dry run)" 1877 } elseif {[catch {portimage::deactivate $portname $version_installed$oldvariant $optionslist} result]} { 1865 1878 global errorInfo 1866 1879 ui_debug "$errorInfo" 1867 1880 ui_error "Deactivating $portname $version_installed failed: $result" -
src/port1.0/portutil.tcl
1006 1006 } 1007 1007 1008 1008 ########### Internal Dependency Manipulation Procedures ########### 1009 global ports_dry_last_skipped 1010 set ports_dry_last_skipped "" 1009 1011 1010 1012 proc 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 1012 1014 set result 0 1013 1015 set skipped 0 1014 1016 set procedure [ditem_key $ditem procedure] … … 1077 1079 } 1078 1080 1079 1081 } 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 } 1080 1094 1081 1095 # otherwise execute the task. 1082 1096 if {$skipped == 0} { … … 1432 1446 } 1433 1447 1434 1448 proc check_variants {variations target} { 1435 global ports_force PortInfo1449 global ports_force ports_dryrun PortInfo 1436 1450 upvar $variations upvariations 1437 1451 set result 0 1438 1452 set portname $PortInfo(name) … … 1452 1466 if {[check_statefile_variants upvariations $state_fd]} { 1453 1467 ui_error "Requested variants do not match original selection.\nPlease perform 'port clean $portname' or specify the force option." 1454 1468 set result 1 1455 } else { 1469 } elseif {!([info exists ports_dryrun] 1470 && $ports_dryrun == "yes")} { 1456 1471 # Write variations out to the statefile 1457 1472 foreach key [array names upvariations *] { 1458 1473 write_statefile variant $upvariations($key)$key $state_fd