[59833] trunk/base/src

jmr at macports.org jmr at macports.org
Fri Oct 23 09:28:40 PDT 2009


Revision: 59833
          http://trac.macports.org/changeset/59833
Author:   jmr at macports.org
Date:     2009-10-23 09:28:37 -0700 (Fri, 23 Oct 2009)
Log Message:
-----------
warn only once about lack of root privileges

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

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2009-10-23 15:54:09 UTC (rev 59832)
+++ trunk/base/src/macports1.0/macports.tcl	2009-10-23 16:28:37 UTC (rev 59833)
@@ -215,6 +215,14 @@
     proc ui_$priority {args} [subst { eval macports::ui_init $priority \$args }]
 }
 
+proc ui_warn_once {id msg} {
+    variable macports::warning_done
+    if {![info exists macports::warning_done($id)]} {
+        ui_warn $msg
+        set macports::warning_done($id) 1
+    }
+}
+
 # Replace puts to catch errors (typically broken pipes when being piped to head)
 rename puts tcl::puts
 proc puts {args} {
@@ -823,6 +831,8 @@
     }
     $workername alias ui_prefix ui_prefix
     $workername alias ui_channels ui_channels
+    
+    $workername alias ui_warn_once ui_warn_once
 
     # Export some utility functions defined here.
     $workername alias macports_create_thread macports::create_thread

Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl	2009-10-23 15:54:09 UTC (rev 59832)
+++ trunk/base/src/port1.0/portutil.tcl	2009-10-23 16:28:37 UTC (rev 59833)
@@ -1494,7 +1494,7 @@
     }
     
     if { [getuid] != 0 } {
-        ui_msg "MacPorts running without privileges.\
+        ui_warn_once "privileges" "MacPorts running without privileges.\
                 You may be unable to complete certain actions (e.g. install)."
     }
     
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20091023/d7392e2e/attachment-0001.html>


More information about the macports-changes mailing list