[88725] trunk/base/src/macports1.0/macports.tcl

jmr at macports.org jmr at macports.org
Mon Jan 9 14:13:13 PST 2012


Revision: 88725
          http://trac.macports.org/changeset/88725
Author:   jmr at macports.org
Date:     2012-01-09 14:13:12 -0800 (Mon, 09 Jan 2012)
Log Message:
-----------
add macports.conf options to control rev-upgrade (on/off/report-only), and fix buildfromsource option

Modified Paths:
--------------
    trunk/base/src/macports1.0/macports.tcl

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2012-01-09 21:56:12 UTC (rev 88724)
+++ trunk/base/src/macports1.0/macports.tcl	2012-01-09 22:13:12 UTC (rev 88725)
@@ -49,7 +49,7 @@
         mp_remote_url mp_remote_submit_url configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
         applications_dir frameworks_dir developer_dir universal_archs build_arch macosx_deployment_target \
         macportsuser proxy_override_env proxy_http proxy_https proxy_ftp proxy_rsync proxy_skip \
-        master_site_local patch_site_local archive_site_local buildfromsource"
+        master_site_local patch_site_local archive_site_local buildfromsource revupgrade_mode revupgrade_check_id_loadcmds"
     variable user_options "submitter_name submitter_email submitter_key"
     variable portinterp_options "\
         portdbpath porturl portpath portbuildpath auto_path prefix prefix_frozen portsharepath \
@@ -695,8 +695,10 @@
         && [info exists macports::buildfromsource]} {
         if {${macports::buildfromsource} == "never"} {
             set macports::global_options(ports_binary_only) yes
+            set temp_options(ports_binary_only) yes
         } elseif {${macports::buildfromsource} == "always"} {
             set macports::global_options(ports_source_only) yes
+            set temp_options(ports_source_only) yes
         } elseif {${macports::buildfromsource} != "ifneeded"} {
             ui_warn "'buildfromsource' set to unknown value '${macports::buildfromsource}', using 'ifneeded' instead"
         }
@@ -845,6 +847,15 @@
         set macports::macosx_deployment_target $macosx_version
     }
 
+    if {![info exists macports::revupgrade_mode]} {
+        set macports::revupgrade_mode "rebuild"
+    }
+    if {![info exists macports::global_options(ports_rev-upgrade_id-loadcmd-check)]
+         && [info exists macports::revupgrade_check_id_loadcmds]} {
+        set macports::global_options(ports_rev-upgrade_id-loadcmd-check) ${macports::revupgrade_check_id_loadcmds}
+        set temp_options(ports_rev-upgrade_id-loadcmd-check) ${macports::revupgrade_check_id_loadcmds}
+    }
+
     # make tools we run operate in UTF-8 mode
     set env(LANG) en_US.UTF-8
 
@@ -3837,12 +3848,15 @@
 }
 
 proc macports::revupgrade {opts} {
+    if {${macports::revupgrade_mode} == "off"} {
+        return 0
+    }
     set run_loop 1
     array set broken_port_counts {}
     while {$run_loop == 1} {
         set run_loop [revupgrade_scanandrebuild broken_port_counts $opts]
     }
-    return 0;
+    return 0
 }
 
 # returns 1 if ports were rebuilt and revupgrade_scanandrebuild should be called again
@@ -4044,17 +4058,19 @@
 
         if {[llength $broken_files] == 0} {
             ui_msg "$macports::ui_prefix No broken files found."
-            return 0;
+            return 0
         }
         ui_msg "$macports::ui_prefix Found [llength $broken_files] broken file(s), matching files to ports"
         set broken_ports {}
         set broken_files [lsort -unique $broken_files]
         foreach file $broken_files {
             set port [registry::entry owner $file]
-            if {$port == ""} {
+            if {$port != ""} {
+                lappend broken_ports $port
+                lappend broken_files_by_port($port) $file
+            } else {
                 ui_error "Broken file $file doesn't belong to any port."
             }
-            lappend broken_ports $port
         }
         set broken_ports [lsort -unique $broken_ports]
 
@@ -4069,6 +4085,17 @@
             }
         }
 
+        if {${macports::revupgrade_mode} != "rebuild"} {
+            ui_msg "$macports::ui_prefix Found [llength $broken_ports] broken port(s):"
+            foreach port $broken_ports {
+                ui_msg "     [$port name] @[$port version] [$port variants][$port negated_variants]"
+                foreach f $broken_files_by_port($port) {
+                    ui_msg "         $f"
+                }
+            }
+            return 0
+        }
+
         ui_msg "$macports::ui_prefix Found [llength $broken_ports] broken port(s), determining rebuild order"
         # broken_ports are the nodes in our graph
         # now we need adjacents
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120109/ad21aa26/attachment.html>


More information about the macports-changes mailing list