Re: terminal emulators using /usr/local/share/terminfo and a bug in perl's Term::Cap
On Sun, Oct 2, 2011 at 8:22 AM, Nicholas Marriott nicholas.marri...@gmail.com wrote: This seems fine to me, but I'm not a perl guru. Have you talked to upstream? I'm having big difficulties trying to report the bug on rt.cpan.org. It seems they do all the best to make you feel uncomfortable :( Can this be fixed locally at least for now if my patch is correct? ciao David On Thu, Sep 29, 2011 at 10:49:36AM +0200, David Coppa wrote: Hi, The patch to ncurses nicm@ commited some days ago, exposes a bug in perl's cpan/Term-Cap/Cap.pm. So, when you use rxvt-unicode on a recent -current, you will hit this bug with pkg_* tools: # pkg_delete -v xclip failed termcap lookup on rxvt-unicode-256color at /usr/libdata/perl5/OpenBSD/ProgressMeter/Term.pm line 125 If you use a terminal emulator that has a terminfo entry but not a termcap one (just like x11/rxvt-unicode or x11/st), you should fall back to the case where perl uses infocmp to fake up a termcap entry from terminfo, but this never happens because the logic is flawed. Here's a diff: Index: cpan/Term-Cap/Cap.pm === RCS file: /cvs/src/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 Cap.pm --- cpan/Term-Cap/Cap.pm 24 Sep 2010 14:49:05 - 1.1.1.1 +++ cpan/Term-Cap/Cap.pm 29 Sep 2011 08:14:46 - @@ -273,7 +273,7 @@ sub Tgetent my @termcap_path = termcap_path(); -unless ( @termcap_path || $entry ) +if ( !@termcap_path || !$entry ) { # last resort--fake up a termcap from terminfo --- cheers, David
Re: terminal emulators using /usr/local/share/terminfo and a bug in perl's Term::Cap
I can't really follow what it is trying to do. Won't your change always call infocmp if TERMCAP is not set instead of searching through the files? It looks like currently infocmp is only used if there are no termcap files at all, not if the entry is missing from the files it does find. So shouldn't the fallback infocmp call happen much later? Somewhere around the line: croak Can't find $term if $entry eq ''; On Thu, Oct 06, 2011 at 04:46:45PM +0200, David Coppa wrote: On Sun, Oct 2, 2011 at 8:22 AM, Nicholas Marriott nicholas.marri...@gmail.com wrote: This seems fine to me, but I'm not a perl guru. Have you talked to upstream? I'm having big difficulties trying to report the bug on rt.cpan.org. It seems they do all the best to make you feel uncomfortable :( Can this be fixed locally at least for now if my patch is correct? ciao David On Thu, Sep 29, 2011 at 10:49:36AM +0200, David Coppa wrote: Hi, The patch to ncurses nicm@ commited some days ago, exposes a bug in perl's cpan/Term-Cap/Cap.pm. So, when you use rxvt-unicode on a recent -current, you will hit this bug with pkg_* tools: # pkg_delete -v xclip failed termcap lookup on rxvt-unicode-256color at /usr/libdata/perl5/OpenBSD/ProgressMeter/Term.pm line 125 If you use a terminal emulator that has a terminfo entry but not a termcap one (just like x11/rxvt-unicode or x11/st), you should fall back to the case where perl uses infocmp to fake up a termcap entry from terminfo, but this never happens because the logic is flawed. Here's a diff: Index: cpan/Term-Cap/Cap.pm === RCS file: /cvs/src/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 Cap.pm --- cpan/Term-Cap/Cap.pm ? ? ?24 Sep 2010 14:49:05 - ? ? ?1.1.1.1 +++ cpan/Term-Cap/Cap.pm ? ? ?29 Sep 2011 08:14:46 - @@ -273,7 +273,7 @@ sub Tgetent ? ? ?my @termcap_path = termcap_path(); - ? ?unless ( @termcap_path || $entry ) + ? ?if ( !@termcap_path || !$entry ) ? ? ?{ ? ? ? ? ?# last resort--fake up a termcap from terminfo --- cheers, David
Re: terminal emulators using /usr/local/share/terminfo and a bug in perl's Term::Cap
On Thu, Oct 06, 2011 at 04:00:21PM +0100, Nicholas Marriott wrote: I can't really follow what it is trying to do. Won't your change always call infocmp if TERMCAP is not set instead of searching through the files? It looks like currently infocmp is only used if there are no termcap files at all, not if the entry is missing from the files it does find. So shouldn't the fallback infocmp call happen much later? Somewhere around the line: croak Can't find $term if $entry eq ''; On Thu, Oct 06, 2011 at 04:46:45PM +0200, David Coppa wrote: On Sun, Oct 2, 2011 at 8:22 AM, Nicholas Marriott nicholas.marri...@gmail.com wrote: This seems fine to me, but I'm not a perl guru. Have you talked to upstream? I'm having big difficulties trying to report the bug on rt.cpan.org. It seems they do all the best to make you feel uncomfortable :( Can this be fixed locally at least for now if my patch is correct? ciao David On Thu, Sep 29, 2011 at 10:49:36AM +0200, David Coppa wrote: Hi, The patch to ncurses nicm@ commited some days ago, exposes a bug in perl's cpan/Term-Cap/Cap.pm. So, when you use rxvt-unicode on a recent -current, you will hit this bug with pkg_* tools: # pkg_delete -v xclip failed termcap lookup on rxvt-unicode-256color at /usr/libdata/perl5/OpenBSD/ProgressMeter/Term.pm line 125 If you use a terminal emulator that has a terminfo entry but not a termcap one (just like x11/rxvt-unicode or x11/st), you should fall back to the case where perl uses infocmp to fake up a termcap entry from terminfo, but this never happens because the logic is flawed. Here's a diff: Index: cpan/Term-Cap/Cap.pm === RCS file: /cvs/src/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 Cap.pm --- cpan/Term-Cap/Cap.pm ? ? ?24 Sep 2010 14:49:05 - ? ? ?1.1.1.1 +++ cpan/Term-Cap/Cap.pm ? ? ?29 Sep 2011 08:14:46 - @@ -273,7 +273,7 @@ sub Tgetent ? ? ?my @termcap_path = termcap_path(); - ? ?unless ( @termcap_path || $entry ) + ? ?if ( !@termcap_path || !$entry ) ? ? ?{ ? ? ? ? ?# last resort--fake up a termcap from terminfo --- cheers, David I want to test it, which I haven't had the time to do yet.
Re: terminal emulators using /usr/local/share/terminfo and a bug in perl's Term::Cap
This seems fine to me, but I'm not a perl guru. Have you talked to upstream? Cheers On Thu, Sep 29, 2011 at 10:49:36AM +0200, David Coppa wrote: Hi, The patch to ncurses nicm@ commited some days ago, exposes a bug in perl's cpan/Term-Cap/Cap.pm. So, when you use rxvt-unicode on a recent -current, you will hit this bug with pkg_* tools: # pkg_delete -v xclip failed termcap lookup on rxvt-unicode-256color at /usr/libdata/perl5/OpenBSD/ProgressMeter/Term.pm line 125 If you use a terminal emulator that has a terminfo entry but not a termcap one (just like x11/rxvt-unicode or x11/st), you should fall back to the case where perl uses infocmp to fake up a termcap entry from terminfo, but this never happens because the logic is flawed. Here's a diff: Index: cpan/Term-Cap/Cap.pm === RCS file: /cvs/src/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 Cap.pm --- cpan/Term-Cap/Cap.pm 24 Sep 2010 14:49:05 - 1.1.1.1 +++ cpan/Term-Cap/Cap.pm 29 Sep 2011 08:14:46 - @@ -273,7 +273,7 @@ sub Tgetent my @termcap_path = termcap_path(); -unless ( @termcap_path || $entry ) +if ( !@termcap_path || !$entry ) { # last resort--fake up a termcap from terminfo --- cheers, David
terminal emulators using /usr/local/share/terminfo and a bug in perl's Term::Cap
Hi, The patch to ncurses nicm@ commited some days ago, exposes a bug in perl's cpan/Term-Cap/Cap.pm. So, when you use rxvt-unicode on a recent -current, you will hit this bug with pkg_* tools: # pkg_delete -v xclip failed termcap lookup on rxvt-unicode-256color at /usr/libdata/perl5/OpenBSD/ProgressMeter/Term.pm line 125 If you use a terminal emulator that has a terminfo entry but not a termcap one (just like x11/rxvt-unicode or x11/st), you should fall back to the case where perl uses infocmp to fake up a termcap entry from terminfo, but this never happens because the logic is flawed. Here's a diff: Index: cpan/Term-Cap/Cap.pm === RCS file: /cvs/src/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 Cap.pm --- cpan/Term-Cap/Cap.pm24 Sep 2010 14:49:05 - 1.1.1.1 +++ cpan/Term-Cap/Cap.pm29 Sep 2011 08:14:46 - @@ -273,7 +273,7 @@ sub Tgetent my @termcap_path = termcap_path(); -unless ( @termcap_path || $entry ) +if ( !@termcap_path || !$entry ) { # last resort--fake up a termcap from terminfo --- cheers, David