[72263] trunk/base/src/port/port.tcl

jberry at macports.org jberry at macports.org
Sat Oct 9 09:22:34 PDT 2010


Revision: 72263
          http://trac.macports.org/changeset/72263
Author:   jberry at macports.org
Date:     2010-10-09 09:22:31 -0700 (Sat, 09 Oct 2010)
Log Message:
-----------
Slight cleanup of editor invocation

Modified Paths:
--------------
    trunk/base/src/port/port.tcl

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2010-10-09 15:58:04 UTC (rev 72262)
+++ trunk/base/src/port/port.tcl	2010-10-09 16:22:31 UTC (rev 72263)
@@ -3479,10 +3479,9 @@
                     
                     # Find an editor to edit the portfile
                     set editor ""
-                    if {[info exists local_options(ports_edit_editor)]} {
-                        set editor [join $local_options(ports_edit_editor)]
-                    } elseif {[info exists local_options(ports_ed_editor)]} {
-                        set editor [join $local_options(ports_ed_editor)]
+                    set editor_var "ports_${action}_editor"
+                    if {[info exists local_options(editor_var)]} {
+                        set editor [join $local_options(editor_var)]
                     } else {
                         foreach ed { VISUAL EDITOR } {
                             if {[info exists env($ed)]} {
@@ -3492,8 +3491,10 @@
                         }
                     }
                     
-                    # Invoke the editor, with a reasonable canned default.
+                    # Use a reasonable canned default if no editor specified or set in env
                     if { $editor == "" } { set editor "/usr/bin/vi" }
+                    
+                    # Invoke the editor
                     if {[catch {eval exec >@stdout <@stdin 2>@stderr $editor {$portfile}} result]} {
                         global errorInfo
                         ui_debug "$errorInfo"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20101009/28d7b9c7/attachment.html>


More information about the macports-changes mailing list