Package: module-assistant
Version: 0.10.11
Severity: normal
Tags: patch

I have a cronjob which includes the following:

  /usr/bin/module-assistant --non-inter --quiet update

However when it runs overnight, I get the following email back from cron:

  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

Since tput is only used to set rows and columns for the graphical interface, 
I have written a patch which moves this code after the parsing of the options
and doesn't call tput if the "no_gui" option is set (such as when running in
non-interactive mode).

(I filed this bug earlier [0] but then erroneously closed it thinking it had
been fixed.  It hasn't and the original bug report has been archived, so I am
posting it again.)

Francois

[0] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=408718

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.23.12-hrt3-grsec (SMP w/2 CPU cores)
Locale: LANG=fr_CA, LC_CTYPE=fr_CA (charmap=UTF-8) (ignored: LC_ALL set to 
fr_CA.utf8)
Shell: /bin/sh linked to /bin/bash

Versions of packages module-assistant depends on:
ii  libtext-wrapi18n-perl         0.06-5     internationalized substitute of Te
ii  perl                          5.8.8-12   Larry Wall's Practical Extraction 

Versions of packages module-assistant recommends:
ii  liblocale-gettext-perl        1.05-1     Using libc functions for internati

-- no debconf information
--- module-assistant.original   2007-01-26 11:43:28.000000000 -0500
+++ module-assistant    2007-01-26 11:47:42.000000000 -0500
@@ -29,17 +29,6 @@
   }
 }
 
-# not so nice, but sufficient. See #396299 for details.
-delete $ENV{'VERSION'};
-chomp($rows=`tput lines`);
-chomp($columns=`tput cols`);
-$rows=25 if !$rows;
-$columns=80 if !$columns;
-
-$columns--;
-# fallback, don't confuse wrap
-$columns=40 if ($columns < 10);
-
 my $ret=0;
 
 use Getopt::Long qw(:config no_ignore_case bundling pass_through);
@@ -172,6 +161,19 @@
 
 $opt_nogui=1 if $opt_noninter;
 
+# not so nice, but sufficient. See #396299 for details.
+delete $ENV{'VERSION'};
+if(!$opt_nogui) {
+    chomp($rows=`tput lines`);
+    chomp($columns=`tput cols`);
+}
+$rows=25 if !$rows;
+$columns=80 if !$columns;
+
+$columns--;
+# fallback, don't confuse wrap
+$columns=40 if ($columns < 10);
+
 my $command=shift(@ARGV);
 @[EMAIL PROTECTED];
 @opt_kverslist = split(/,|\ |\r|\n/,join(',',@opt_kverslist));
@@ -320,8 +322,10 @@
       print @_; 
    }
 }
-$smso=`tput smso`;
-$rmso=`tput rmso`;
+if(!$opt_nogui) {
+    $smso=`tput smso`;
+    $rmso=`tput rmso`;
+}
 
 sub printmsg {
    my $orgcolumns=$columns;

Reply via email to