"m-a -t" uses tput(1) and terminal escape sequences incorrectly

Bug #284181 reported by Daniel Richard G.
2
Affects Status Importance Assigned to Milestone
module-assistant (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: module-assistant

This is module-assistant 0.10.11ubuntu1 in hardy.

module-assistant, in --text-mode, typically uses terminal escape sequences to highlight certain lines in its output (e.g. the "dpkg -Ei ..." invocation). However, it does two things incorrectly:

1. It uses these escape sequences even if the output is being redirected to a file. That is, it is not checking that the output is actually going to a tty. Compare that to the behavior of, say, "ls --color=auto".

2. If it is invoked from (for example) a cron job, where the TERM variable is unset, you see this in the output:

--------
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
................................................................................
.....Getting source for kernel version: 2.6.24-21-generic
Kernel headers available in /usr/src/linux-headers-2.6.24-21-generic
Creating symlink...
apt-get install build-essential
--------

So module-assistant is being rather careless about how it uses tput(1) and terminal escape sequences. In both of the above cases, it ought to know better than to blindly assume it is connected to a tty.

As a workaround, setting TERM=dumb will get rid of both the escape sequences, and the tput(1) errors, making the output clean and suitable for a log file.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package module-assistant - 0.11.7

---------------
module-assistant (0.11.7) unstable; urgency=low

  * d/rules: pristine-tar-commit: Apply s/~/_/ when converting version to tag.
  * Fix most hyphen-used-as-minus-sign in the manpage.
  * Remove support for compilers that have been removed after squeeze.
  * Add Build-Depends: docbook. (Closes: #744819)
  * Update compliant.list:
    - acerhk-source
    - alsa-source (Closes: #699858)
    + bbswitch-source
    - bcm5700-source
    - cdfs-src
    - comedi-source
    - ipset-source
    - linux-wlan-ng-source
    - lirc-modules-source
    - loop-aes-source
    - lustre-source
    - qc-usb-source
    - sysprof-module-source
    - virtualbox-ose-source
  * Bump Standards-Version to 3.9.5 (no changes needed).
  * Do not call tput in non-gui sessions, thanks to Francois Marier.
    (Closes: #459977) (LP: #284181)

 -- Andreas Beckmann <email address hidden> Wed, 23 Apr 2014 10:28:50 +0200

Changed in module-assistant (Ubuntu):
status: New → Fix Released
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.