r27547 - in /branches/upstream/libterm-size-perl/current: Changes MANIFEST META.yml Makefile.PL Size.pm Size.xs t/ t/00_use.t t/01_basic.t t/99_pod.t test.pl

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Mon Dec 1 08:47:26 UTC 2008


Author: dmn
Date: Mon Dec  1 08:47:20 2008
New Revision: 27547

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=27547
Log:
[svn-upgrade] Integrating new upstream version, libterm-size-perl (0.207)

Added:
    branches/upstream/libterm-size-perl/current/META.yml
    branches/upstream/libterm-size-perl/current/t/
    branches/upstream/libterm-size-perl/current/t/00_use.t
    branches/upstream/libterm-size-perl/current/t/01_basic.t
    branches/upstream/libterm-size-perl/current/t/99_pod.t
Removed:
    branches/upstream/libterm-size-perl/current/test.pl
Modified:
    branches/upstream/libterm-size-perl/current/Changes
    branches/upstream/libterm-size-perl/current/MANIFEST
    branches/upstream/libterm-size-perl/current/Makefile.PL
    branches/upstream/libterm-size-perl/current/Size.pm
    branches/upstream/libterm-size-perl/current/Size.xs

Modified: branches/upstream/libterm-size-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-size-perl/current/Changes?rev=27547&op=diff
==============================================================================
--- branches/upstream/libterm-size-perl/current/Changes (original)
+++ branches/upstream/libterm-size-perl/current/Changes Mon Dec  1 08:47:20 2008
@@ -1,7 +1,51 @@
 Revision history for Perl extension Term::Size.
 
-0.2 1997-05-13
+0.207 2008-08-16  Term-Size
+        - the original code for retrieving terminal size
+          via XS ioctl is back -- and this dist
+          is again Unix-centric
+        - use Term::Size::Any for platform independency
+
+0.205 2008-02-27  Term-Size-Unix
+        - disabled prototypes in XS code - too misleading
+          to be useful
+        - borrowed rewritten test from Term::Size::Any
+          (which should fix most test failures)
+        - NOTE: this distribution will disappear soon,
+          merging back to the original Term-Size dist
+
+0.204 2006-09-13  Term-Size-Unix
+        - included license in Makefile.PL
+
+0.203 2006-05-21  Term-Size-Unix
+	- moved sources from Term-Size to this distribution
+	- bug fixed: &pixels always used fd 0 rather than fileno(f)
+	- added test scripts "t/00_use.t" and "t/99_pod.t"
+
+0.203 2006-05-21  Term-Size
+	- bug fixed: &pixels always used fd 0 rather than fileno(f)
+	- experimental support for Win32 was introduced by
+	  adding a dependency on Term::Size::Win32
+	- added test scripts "t/00_use.t" and "t/99_pod.t"
+	- the XS code moved to distribution Term::Size::Unix -
+	  this module is now a thin skin to call the appropriate
+	  module Term::Size::Unix or Term::Size::Win32
+
+0.202 2006-05-19  Term-Size
+	- inserted a note to say this is an UNOFFICIAL distribution
+
+0.201 2006-05-18  Term-Size
+	- 'test.pl' rewritten with Test::More and renamed to 't/01_basic.t'
+	- an initializer is now used when creating a struct winsize
+	  to avoid what looks like a bug on Cygwin: ioctl(., TIOCGWINSZ, .)
+	  does not set ws_xpixel and ws_ypixel fields, leaving them untouched.
+	  If they contained garbage, they kept the garbage
+	- attempt to restore AIX compatibility according to suggestion
+	  in CPAN RT #11539 (by jydawg [at] xs4all.nl): "termios.h" 
+	  is not where Unix thinks it should
+
+0.2 1997-05-13  Term-Size
 	- support filehandle arguments
 
-0.1 1997-04-23
+0.1 1997-04-23  Term-Size
 	- original version

Modified: branches/upstream/libterm-size-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-size-perl/current/MANIFEST?rev=27547&op=diff
==============================================================================
--- branches/upstream/libterm-size-perl/current/MANIFEST (original)
+++ branches/upstream/libterm-size-perl/current/MANIFEST Mon Dec  1 08:47:20 2008
@@ -1,9 +1,13 @@
 Copyright
 Changes
-INSTALL
 MANIFEST
 Makefile.PL
 README
+INSTALL
 Size.pm
 Size.xs
-test.pl
+
+t/00_use.t
+t/01_basic.t
+t/99_pod.t
+META.yml                                 Module meta-data (added by MakeMaker)

Added: branches/upstream/libterm-size-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-size-perl/current/META.yml?rev=27547&op=file
==============================================================================
--- branches/upstream/libterm-size-perl/current/META.yml (added)
+++ branches/upstream/libterm-size-perl/current/META.yml Mon Dec  1 08:47:20 2008
@@ -1,0 +1,13 @@
+--- #YAML:1.0
+name:                Term-Size
+version:             0.207
+abstract:            Retrieve terminal size (Unix version)
+license:             perl
+author:              ~
+generated_by:        ExtUtils::MakeMaker version 6.44
+distribution_type:   module
+requires:     
+    Test::More:                    0
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
+    version: 1.3

Modified: branches/upstream/libterm-size-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-size-perl/current/Makefile.PL?rev=27547&op=diff
==============================================================================
--- branches/upstream/libterm-size-perl/current/Makefile.PL (original)
+++ branches/upstream/libterm-size-perl/current/Makefile.PL Mon Dec  1 08:47:20 2008
@@ -1,6 +1,28 @@
+
+use 5;
 use ExtUtils::MakeMaker;
 
+my $EUMM_VERSION = eval $ExtUtils::MakeMaker::VERSION;
+my $is_win32 = ($^O =~ /MSWin/i);
+
 WriteMakefile(
-	'NAME'		=> 'Term::Size',
-	'VERSION_FROM'	=> 'Size.pm',
-);
+	'NAME'          => 'Term::Size',
+	'VERSION_FROM'  => 'Size.pm',
+	'PREREQ_PM'     => {
+		'Test::More'            => 0, # build
+	}, 
+	($] >= 5.005 ? (
+		'ABSTRACT_FROM' => 'Size.pm',
+	) : ()),
+        ($EUMM_VERSION >= 6.30_01 ? (
+	        LICENSE => 'perl', # needs EEUU > 6.30_01
+        ) : ()),
+
+) unless $is_win32;
+
+ExtUtils::MakeMaker::WriteEmptyMakefile(
+	'NAME'          => 'Term::Size',
+	'VERSION_FROM'  => 'Size.pm',
+) if $is_win32;
+
+

Modified: branches/upstream/libterm-size-perl/current/Size.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-size-perl/current/Size.pm?rev=27547&op=diff
==============================================================================
--- branches/upstream/libterm-size-perl/current/Size.pm (original)
+++ branches/upstream/libterm-size-perl/current/Size.pm Mon Dec  1 08:47:20 2008
@@ -11,11 +11,11 @@
 @ISA = qw(Exporter DynaLoader);
 @EXPORT_OK = qw(chars pixels);
 
-$VERSION = '0.2';
+$VERSION = '0.207';
 
 =head1 NAME
 
-Term::Size - Perl extension for retrieving terminal size
+Term::Size - Retrieve terminal size (Unix version)
 
 =head1 SYNOPSIS
 
@@ -25,6 +25,21 @@
     ($x, $y) = Term::Size::pixels;
 
 =head1 DESCRIPTION
+
+  THIS IS AN UNOFFICIAL PATCH AGAINST Term-Size 0.2 DISTRIBUTION 
+  FOUND ON CPAN (http://search.cpan.org/~timpx/Term-Size-0.2/).
+  IT IS UNOFFICIAL IN THE SENSE THAT THE AUTHOR Tim Goodwin 
+  HASN'T APPROVED IT (YET, I HOPE). BECAUSE OF THIS, THIS 
+  DISTRIBUTION IS NOT INDEXED AND AVAILABLE VIA cpan OR cpanp 
+  SHELLS UNLESS YOU EXPLICITLY SAY 
+  "install FERREIRA/Term-Size-0.203.tar.gz". 
+  
+  THIS IS UNDELICATE? I THINK IT IS IN A CERTAIN SENSE. BUT IT 
+  IS A WAY TO UNFREEZE THE CURRENT DISTRIBUTION STATUS. IF TIM 
+  DISAPPROVES, I WILL REMOVE THIS DISTRIBUTION RIGHT AWAY. 
+  IF HE APPROVES, I WILL REMOVE THIS DISTRIBUTION RIGHT AWAY 
+  AND WORK OUT (AFTER BEEN GIVEN MAINTAINERSHIP STATUS) 
+  A DISTRIBUTION WITHOUT THIS NOTE AND WHICH INDEXES CORRECTLY.
 
 B<Term::Size> is a Perl module which provides a straightforward way to
 retrieve the terminal size.
@@ -87,6 +102,9 @@
 
 Tim Goodwin, <tim at uunet.pipex.com>, 1997-04-23.
 
+Candidate for maintainership:
+Adriano Ferreira, <ferreira at cpan.org>, 2006-05-19.
+
 =cut
 
 bootstrap Term::Size $VERSION;

Modified: branches/upstream/libterm-size-perl/current/Size.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-size-perl/current/Size.xs?rev=27547&op=diff
==============================================================================
--- branches/upstream/libterm-size-perl/current/Size.xs (original)
+++ branches/upstream/libterm-size-perl/current/Size.xs Mon Dec  1 08:47:20 2008
@@ -6,7 +6,11 @@
 #include "perl.h"
 #include "XSUB.h"
 
+#ifndef _AIX
 #include <sys/termios.h>
+#else
+#include <termios.h>
+#endif
 
 #ifdef __cplusplus
 }
@@ -14,14 +18,14 @@
 
 MODULE = Term::Size		PACKAGE = Term::Size
 
-PROTOTYPES: ENABLE
+PROTOTYPES: DISABLE
 
 void
 chars( f = stdin )
 	FILE *f;
 
 	PREINIT:
-	struct winsize w;
+	struct winsize w = { 0, 0, 0, 0 };
 
 	PPCODE:
 	if (ioctl(fileno(f), TIOCGWINSZ, &w) == -1)
@@ -36,10 +40,10 @@
 	FILE *f;
 
 	PREINIT:
-	struct winsize w;
+	struct winsize w = { 0, 0, 0, 0 };
 
 	PPCODE:
-	if (ioctl(0, TIOCGWINSZ, &w) == -1)
+	if (ioctl(fileno(f), TIOCGWINSZ, &w) == -1)
 		XSRETURN_NO;
 
 	XPUSHs(sv_2mortal(newSViv(w.ws_xpixel)));

Added: branches/upstream/libterm-size-perl/current/t/00_use.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-size-perl/current/t/00_use.t?rev=27547&op=file
==============================================================================
--- branches/upstream/libterm-size-perl/current/t/00_use.t (added)
+++ branches/upstream/libterm-size-perl/current/t/00_use.t Mon Dec  1 08:47:20 2008
@@ -1,0 +1,6 @@
+
+use Test::More tests => 1;
+
+BEGIN { use_ok('Term::Size'); }
+
+diag( "Testing Term::Size $Term::Size::VERSION, Perl $], $^X" );

Added: branches/upstream/libterm-size-perl/current/t/01_basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-size-perl/current/t/01_basic.t?rev=27547&op=file
==============================================================================
--- branches/upstream/libterm-size-perl/current/t/01_basic.t (added)
+++ branches/upstream/libterm-size-perl/current/t/01_basic.t Mon Dec  1 08:47:20 2008
@@ -1,0 +1,48 @@
+
+use Test::More tests => 17;
+
+# this script is for testing Term::Size default behavior
+
+BEGIN { use_ok('Term::Size', qw( chars pixels )); }
+
+my @handles = (
+    # name args handle
+    [ 'implicit STDIN', [], *STDIN ], # default: implicit STDIN
+    [ 'STDIN', [*STDIN], *STDIN ],
+    [ 'STDERR', [*STDERR], *STDERR ],
+    [ 'STDOUT', [*STDOUT], *STDOUT ],
+);
+
+for (@handles) {
+    my $h_name = $_->[0];
+    my @args = @{$_->[1]};
+    my $h = $_->[2];
+
+    SKIP: {
+    skip "$h_name is not tty", 4 unless -t $h;
+
+    my @chars = chars @args;
+    is(scalar @chars, 2, "$h_name: chars return (cols, rows) - $h_name");
+
+    my $cols = chars @args;
+    is($cols, $chars[0], "$h_name: chars return cols");
+
+    my @pixels = pixels @args;
+    is(scalar @pixels, 2, "$h_name: pixels return (x, y)");
+
+    my $x = pixels @args;
+    is($x, $pixels[0], "$h_name: pixels return x");
+
+  }
+
+}
+
+if (-t STDIN) {
+    # this is not at test, only a show-off
+    my @chars = chars;
+    my @pixels = pixels;
+    diag("This terminal is $chars[0]x$chars[1] characters,"
+         . " and $pixels[0]x$pixels[1] pixels."
+    );
+
+}

Added: branches/upstream/libterm-size-perl/current/t/99_pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-size-perl/current/t/99_pod.t?rev=27547&op=file
==============================================================================
--- branches/upstream/libterm-size-perl/current/t/99_pod.t (added)
+++ branches/upstream/libterm-size-perl/current/t/99_pod.t Mon Dec  1 08:47:20 2008
@@ -1,0 +1,6 @@
+
+use Test::More;
+eval "use Test::Pod 1.18";
+plan skip_all => "Test::Pod 1.18 required for testing POD" if $@;
+
+all_pod_files_ok(all_pod_files("."));




More information about the Pkg-perl-cvs-commits mailing list