On 09/07/10 06:31, Eric Bélanger wrote:
On Thu, Jul 8, 2010 at 2:56 PM, Dan McGee<[email protected]>  wrote:
On Thu, Jul 8, 2010 at 1:46 PM, Eric Bélanger<[email protected]>  wrote:
On Thu, Jul 8, 2010 at 12:50 PM, Dan McGee<[email protected]>  wrote:
On Thu, Jul 8, 2010 at 10:27 AM, Eric Bélanger<[email protected]>  wrote:
Hi,

This problem is somewhat related to the terminal color problem so I
apologize if it's already taken care by these patches.

I use rxvt-unicode as my terminal.  Since pacman 3.4, when building
packages with makechrootpkg, makepkg aborts with the following error:
tput: unknown terminal "rxvt-unicode"

This happens because I use a clean chroot in which rxvt-unicode isn't
installed so the terminal definition file
/usr/share/terminfo/r/rxvt-unicode isn't present.  As a workaround, I
added a 'TERM=xterm' in the wrapper script I use.

It would be nice if, instead of aborting on unknown terminals, makepkg
would fallback to the dumb terminal. The dumb terminal currently
doesn's work as I believe it doesn't support colors. This change along
with the color patch would make makpkg more robust when handling
different and unusual terminals.

Personnally, I will keep my workaround as I like color.  ;)

http://mailman.archlinux.org/pipermail/pacman-dev/2010-June/011263.html



I tested Nezmer's patch and it fix this problem. However, the error
message is still printed for each call to tput (maybe it should be
sent to /dev/null) but makepkg doen't abort anymore.

What error is printed?

The one mentionned in my first post:
tput: unknown terminal "rxvt-unicode"

Output is always helpful. You don't see any
errors at all with stock makepkg, it just aborts.

dmc...@clifden ~
$ makepkg

==>  ERROR: An unknown error has occurred. Exiting...


Yes, you do.  As I wrote in my first post, to get the tput error, you
need to build a package in a clean chroot with a terminal whose
terminfo file isn't provided by ncurses like rxvt-unicode. Output
below:

Stock makepkg:

$ echo $TERM
rxvt-unicode

$ sudo makechrootpkg -c -r /mnt/current64  -l copy_1  -- --noconfirm --holdver
creating clean working copy...done
grep: /home/eric/.makepkg.conf: No such file or directory
grep: /home/eric/.makepkg.conf: No such file or directory
tput: unknown terminal "rxvt-unicode"

<snip>

I'd almost put this down as a configuration error (wrong TERM exported...) but how about we do something like this to fix both issues we are having here:

if [[ -t 2 && ! $USE_COLOR = "n" && $(check_buildenv color) = "y" ]]; then
  # prefer tput for setting font sytle on systems where it is supported
  if tput setaf 0 &>/dev/null; then
    [set colour/bold the tput way]
  else
    [set colour/bold the old fashioned way]
  fi
fi

Allan

Reply via email to