Bug 99179 - Portupgrade: when STDIN is detected closed, no output is given.
Summary: Portupgrade: when STDIN is detected closed, no output is given.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Sergey Matveychuk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-19 12:30 UTC by Hannes Hauswedell
Modified: 2006-07-02 08:14 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hannes Hauswedell 2006-06-19 12:30:17 UTC
if STDIN is detected closed, subprocesses spawned by portupgrade show no ouput.
STDIN is detected closed if portupgrade is a run inside a KDE or Qt Process.
this makes it impossible to monitor output correctly.

Fix: 

fix the logged_command function (~ lines 480-490) in pkgtools.rb to read


def logged_command(file, args)
  if !file  
    args
  else 
    ['/usr/bin/script', '-qa', file, *args]
  end
end


instead of


def logged_command(file, args)
  if !file  
    args
  elsif STDIN.tty?
    ['/usr/bin/script', '-qa', file, *args]
  else
    ['/bin/sh', '-c', sprintf('%s >>%s 2>&1', shelljoin(*args), shelljoin(file))]
  end
end

basically just remove the STDIN condition for the second call and remove the third.
How-To-Repeat: add <&- on the commandline, e.g.:
portupgrade -v -y -N -PP games/angband <&-
Comment 1 Erwin Lansing freebsd_committer freebsd_triage 2006-06-19 12:31:28 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sem

Over to maintainer.
Comment 2 Sergey Matveychuk freebsd_committer freebsd_triage 2006-07-02 08:14:53 UTC
State Changed
From-To: open->closed

Committed. Thanks!