misc/182148: "time -h portupgrade -aDFR -O" stops sending ^D

Thomas Schweikle tps at vr-web.de
Mon Sep 16 10:30:00 UTC 2013


>Number:         182148
>Category:       misc
>Synopsis:       "time -h portupgrade -aDFR -O" stops sending ^D
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 16 10:30:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Schweikle
>Release:        9.2-PRERELEASE
>Organization:
>Environment:
FreeBSD cc-tps-pfsB-muc.bfs.de 9.2-PRERELEASE FreeBSD 9.2-PRERELEASE #25 r255510: Fri Sep 13 17:27:51 CEST 2013     root at cc-tps-pfsB-muc.bfs.de:/usr/obj/usr/src/sys/CC-TPS-PFSB-MUC  amd64
>Description:
Having a script:
--- snip
#!/bin/sh

timecmd() {
  echo "$(date) -- \"$*\""
  time -h -- $*
  res=$?
  echo
  echo
  return $res
}

timecmd portupgrade -aDFR -O
--- snap

leads to output:
--- snip
# update up
Mon Sep 16 11:28:47 CEST 2013 -- "portupgrade -aDFR -O"
[Reading data from pkg(8) ... - 272 packages found - done]
--->  Fetching the distfile(s) for 'sqlite3-3.8.0.2' (databases/sqlite3)
--->  Fetching '/usr/ports/databases/sqlite3'
^D
--- snap

at this point the script stops. Changing it to read:
--- snip
#!/bin/sh

timecmd() {
  echo "$(date) -- \"$*\""
  time -h -- $*
  res=$?
  echo
  echo
  return $res
}

timecmd portupgrade -aDFR -O \< /dev/null
--- snap

leads to output:
--- snip
# update up
Mon Sep 16 12:22:51 CEST 2013 -- "portupgrade -aDFR -O < /dev/null"
[Reading data from pkg(8) ... - 272 packages found - done]
: date format error

--- snap

Looks like there is something going on inside portupgrade while fiddling with stdio/stderr/stdin giving strange results or leading to hanging processes waiting for input.
>How-To-Repeat:
Copy the above script, execute it to update ports database
>Fix:
Do not use portupgrade with any io-redirects
Do not use "time" or others to execute portupgrade

So really: no fix known.

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list