/usr/bin/annotate-scripts cannot use date format with whitespace

Bug #1300272 reported by Glenn Jackman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
devscripts (Ubuntu)
New
Undecided
Unassigned

Bug Description

$ annotate-output "+%F %T" whoami
date: extra operand `%T'
Try `date --help' for more information.
 I: Started whoami
date: extra operand `%T'
Try `date --help' for more information.
 O: glennj
date: extra operand `%T'
Try `date --help' for more information.
 I: Finished with exitcode 0

This is due to not using double quotes to protect the date format.

Please consider the following diff:

$ diff /usr/bin/annotate-output bin/annotate-output
28c28
< echo "`date ${FMT}` $1: $line"
---
> printf "%s %s: %s\n" "$(date "$FMT")" "$1" "$line"
78c78
< echo "`date ${FMT}` I: Started $@"
---
> addtime I <<< "Started $*"
83c83
< echo "`date ${FMT}` I: Finished with exitcode $EXIT"
---
> addtime I <<< "Finished with exitcode $EXIT"

Test with: annotate-output "+%F %T" sh -c 'echo stdout; echo stderr >&2'

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: devscripts 2.11.6ubuntu1.6
ProcVersionSignature: Ubuntu 3.2.0-60.91-generic-pae 3.2.55
Uname: Linux 3.2.0-60-generic-pae i686
ApportVersion: 2.0.1-0ubuntu17.6
Architecture: i386
Date: Mon Mar 31 10:55:34 2014
InstallationMedia: Ubuntu-Server 12.04.1 LTS "Precise Pangolin" - Release i386 (20120817.3)
MarkForUpload: True
SourcePackage: devscripts
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Glenn Jackman (glenn-jackman) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.