[39214] branches/gsoc08-privileges/base/src/port/port.tcl

pmagrath at macports.org pmagrath at macports.org
Tue Aug 12 10:28:29 PDT 2008


Revision: 39214
          http://trac.macosforge.org/projects/macports/changeset/39214
Author:   pmagrath at macports.org
Date:     2008-08-12 10:28:29 -0700 (Tue, 12 Aug 2008)
Log Message:
-----------
Catch user failing to authenticate to 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:14:40 UTC (rev 39213)
+++ branches/gsoc08-privileges/base/src/port/port.tcl	2008-08-12 17:28:29 UTC (rev 39214)
@@ -2504,7 +2504,14 @@
 			# 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 result 0
-			ui_msg [exec sudo port $target $portname]
+			
+			if {[catch {set sudomsgs [exec sudo port $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."
 		}
 		# end gsoc08-privileges
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080812/fb97551d/attachment.html 


More information about the macports-changes mailing list