[Bug 1300272] [NEW] /usr/bin/annotate-scripts cannot use date format with whitespace

Glenn Jackman glenn.jackman at gmail.com
Mon Mar 31 15:09:15 UTC 2014


Public bug reported:

$ 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)

** Affects: devscripts (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug i386 precise

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to devscripts in Ubuntu.
https://bugs.launchpad.net/bugs/1300272

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

Status in “devscripts” package in Ubuntu:
  New

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)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/devscripts/+bug/1300272/+subscriptions



More information about the foundations-bugs mailing list