[39216] branches/gsoc08-privileges/base/src/port/port.tcl
pmagrath at macports.org
pmagrath at macports.org
Tue Aug 12 10:48:32 PDT 2008
Revision: 39216
http://trac.macosforge.org/projects/macports/changeset/39216
Author: pmagrath at macports.org
Date: 2008-08-12 10:48:32 -0700 (Tue, 12 Aug 2008)
Log Message:
-----------
Use the correct macports install when using re-trying with sudo.
Modified Paths:
--------------
branches/gsoc08-privileges/base/src/port/port.tcl
Modified: branches/gsoc08-privileges/base/src/port/port.tcl
===================================================================
--- branches/gsoc08-privileges/base/src/port/port.tcl 2008-08-12 17:30:45 UTC (rev 39215)
+++ branches/gsoc08-privileges/base/src/port/port.tcl 2008-08-12 17:48:32 UTC (rev 39216)
@@ -2442,7 +2442,7 @@
proc action_target { action portlist opts } {
- global global_variations
+ global global_variations prefix
set status 0
if {[require_portlist portlist]} {
return 1
@@ -2502,17 +2502,19 @@
# start gsoc08-privileges
if { [geteuid] != 0 && $result == 2} {
# mportexec will return an error result code 2 if eval_targets fails due to insufficient privileges.
- ui_info "Attempting port action with 'sudo port': 'sudo port $target $portname'."
+
+ set portbinary "${macports::prefix}/bin/port"
+
+ ui_info "Attempting port action with 'sudo port': 'sudo $portbinary $target $portname'."
set result 0
-
- if {[catch {set sudomsgs [exec sudo port $target $portname]} sudomsgs]} {
+ if {[catch {set sudomsgs [exec sudo $portbinary $target $portname]} sudomsgs]} {
global errorInfo
ui_debug "$errorInfo"
break_softcontinue "Unable to execute port: $errorInfo" 1 status
}
ui_msg $sudomsgs
- ui_debug "'sudo port $target $portname' has completed."
+ ui_debug "'sudo $portbinary $target $portname' has completed."
}
# end gsoc08-privileges
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080812/1aaa6b12/attachment.html
More information about the macports-changes
mailing list