Skip to content

Commit

Permalink
Catch and report nicely any error from editor invocation, just because
Browse files Browse the repository at this point in the history
I know Juan will ask about it. Wait a minute...he already did! ;)

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@14565 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
jdberry committed Oct 11, 2005
1 parent 0bfa671 commit 078b903
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/port/port.tcl
Expand Up @@ -2,7 +2,7 @@
#\
exec @TCLSH@ "$0" "$@"
# port.tcl
# $Id: port.tcl,v 1.122 2005/10/11 20:17:42 jberry Exp $
# $Id: port.tcl,v 1.123 2005/10/11 20:34:55 jberry Exp $
#
# Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org>
# Copyright (c) 2002 Apple Computer, Inc.
Expand Down Expand Up @@ -1743,7 +1743,8 @@ switch -- $action {
# Restore our entire environment from start time
# We need it to evaluate the editor, and the editor
# may want stuff from it as well, like TERM.
array set env [array get boot_env]
array unset env_save; array set env_save [array get env]
array unset env; array set env [array get boot_env]

# Find an editor to edit the portfile
set editor ""
Expand All @@ -1756,8 +1757,15 @@ switch -- $action {
if { $editor == "" } {
fatal "No EDITOR is specified in your environment"
} else {
eval exec $editor $portfile
}
if {[catch {eval exec $editor $portfile} result]} {
global errorInfo
ui_debug "$errorInfo"
fatal_softcontinue "unable to invoke editor: $result"
}
}

# Restore internal dp environment
array unset env; array set env [array get env_save]
}

dir {
Expand Down

0 comments on commit 078b903

Please sign in to comment.