[54716] trunk/base/src/port1.0

jmr at macports.org jmr at macports.org
Fri Jul 31 16:03:58 PDT 2009


Revision: 54716
          http://trac.macports.org/changeset/54716
Author:   jmr at macports.org
Date:     2009-07-31 16:03:57 -0700 (Fri, 31 Jul 2009)
Log Message:
-----------
move the "running without privileges" warning back to open_statefile, so it doesn't get shown for targets that don't touch the workdir

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

Modified: trunk/base/src/port1.0/portmain.tcl
===================================================================
--- trunk/base/src/port1.0/portmain.tcl	2009-07-31 22:58:03 UTC (rev 54715)
+++ trunk/base/src/port1.0/portmain.tcl	2009-07-31 23:03:57 UTC (rev 54716)
@@ -136,14 +136,8 @@
 # or a shared directory owned by the group so use ~/.macports
 if { $euid != 0 && ([info exists workpath] && [file exists $workpath] && ![file writable $workpath]) || [info exists portdbpath] && ![file writable [file join $portdbpath build]] } {
 
-    set userid [getuid]
-    set username [uid_to_name $userid]
+    set username [uid_to_name [getuid]]
 
-    if { $userid !=0 } {
-        ui_msg "MacPorts running without privileges.\
-                You may be unable to complete certain actions (eg install)."
-    }
-
     # set global variable indicating to other functions to use ~/.macports as well
     set usealtworkpath yes
 

Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl	2009-07-31 22:58:03 UTC (rev 54715)
+++ trunk/base/src/port1.0/portutil.tcl	2009-07-31 23:03:57 UTC (rev 54716)
@@ -1503,6 +1503,12 @@
         file mkdir $workpath
         chownAsRoot $workpath
     }
+    
+    if { [getuid] != 0 } {
+        ui_msg "MacPorts running without privileges.\
+                You may be unable to complete certain actions (eg install)."
+    }
+    
     # de-escalate privileges if MacPorts was started with sudo
     dropPrivileges
     
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090731/d30abedb/attachment-0001.html>


More information about the macports-changes mailing list