upgrading/installing in a background process

René J.V. Bertin rjvbertin at gmail.com
Tue May 5 05:23:50 PDT 2015


On Tuesday May 05 2015 10:19:28 Mihai Moldovan wrote:

>If you want to be able to "call it a night", start port like any other process
>on UNIX-like operating systems -- within tmux or screen, so that the file
>descriptors do not simply vanish and the user can detach or reattch at will.

Or, you apply this patch:

{{{
--- /opt/local/var/macports/sources/svn.macports.org/trunk/base/src/macports1.0/macports.tcl    2014-11-18 08:50:51.000000000 -0800
+++ /opt/local/libexec/macports/lib/macports1.0/macports.tcl    2015-05-05 05:19:43.000000000 -0700
@@ -3134,7 +3134,11 @@
     # progress indicator
     if {![macports::ui_isset ports_debug]} {
         ui_info -nonewline .
-        flush stdout
+        if {[catch {flush stdout} error]} {
+            global errorInfo
+            ui_msg {}
+            ui_debug $errorInfo
+        }
     }
 
     if {$target eq {} || $target eq {install} || $target eq {activate}} {
}}}

I think there's really no reason to allow the flush command to abort in this case. The alternative would be to do the tcl equivalent of `if( isatty(stdout) )` because the flush probably makes sense only when stdout is connected to a terminal ...

R.


More information about the macports-dev mailing list