commit perl-Term-ProgressBar for openSUSE:Factory
Hello community, here is the log from the commit of package perl-Term-ProgressBar for openSUSE:Factory checked in at 2014-06-30 21:45:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Term-ProgressBar (Old) and /work/SRC/openSUSE:Factory/.perl-Term-ProgressBar.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "perl-Term-ProgressBar" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Term-ProgressBar/perl-Term-ProgressBar.changes 2013-08-07 20:53:45.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Term-ProgressBar.new/perl-Term-ProgressBar.changes 2014-06-30 21:45:23.000000000 +0200 @@ -1,0 +2,7 @@ +Wed Jun 25 20:47:26 UTC 2014 - mlatimer@suse.com + +- Update to version 2.15 + + Add Term::ProgressBar::IO, which displays a progress bar while reading + from a seekable filehandle + +------------------------------------------------------------------- @@ -9 +16,2 @@ -- Updated spec file to replace perl_requires macro with preferred SUSE Requires: perl >= x.x format +- Updated spec file to replace perl_requires macro with preferred SUSE + Requires: perl >= x.x format @@ -19 +27,2 @@ -- Validated that license is 'per' as listed in Makefile.PL which is GPL or Artistic compliant. The spec file reflects this change. +- Validated that license is 'per' as listed in Makefile.PL which is GPL or + Artistic compliant. The spec file reflects this change. @@ -24,2 +33,3 @@ -- Updated spec file to remove auto/Term-ProgressBar -from the files section that is no longer used in the new version. Removed the BUGS file from the files section in spec file since all changes are not logged in changes +- Updated spec file to remove auto/Term-ProgressBar from the files section + that is no longer used in the new version. Removed the BUGS file from the + files section in spec file since all changes are not logged in changes @@ -40 +50,2 @@ -- Checked license and updated spec. Module states same license as Perl which is GPL-1.0+ or Artistic-1.0 +- Checked license and updated spec. Module states same license as Perl which + is GPL-1.0+ or Artistic-1.0 Old: ---- Term-ProgressBar-2.14.tar.gz New: ---- Term-ProgressBar-2.15.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Term-ProgressBar.spec ++++++ --- /var/tmp/diff_new_pack.nehwS1/_old 2014-06-30 21:45:25.000000000 +0200 +++ /var/tmp/diff_new_pack.nehwS1/_new 2014-06-30 21:45:25.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Term-ProgressBar # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %define modname Term-ProgressBar Name: perl-%{modname} -Version: 2.14 +Version: 2.15 Release: 0 Summary: A progress bar for terminals License: GPL-1.0+ or Artistic-1.0 @@ -68,6 +68,5 @@ %doc README Changes examples %doc %{_mandir}/man?/* %{perl_vendorlib}/Term -#%{perl_vendorarch}/auto/Term-ProgressBar %changelog ++++++ Term-ProgressBar-2.14.tar.gz -> Term-ProgressBar-2.15.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Term-ProgressBar-2.14/Changes new/Term-ProgressBar-2.15/Changes --- old/Term-ProgressBar-2.14/Changes 2013-07-21 12:35:16.000000000 +0200 +++ new/Term-ProgressBar-2.15/Changes 2014-04-13 22:37:09.000000000 +0200 @@ -1,47 +1,49 @@ -Revision history for Perl extension Term-ProgressBar. +Revision history for Perl extension Term-ProgressBar -2.14 Sun Jul 21 13:34:52 2013 +2.15 2014-04-13 23:23:23 + - Add Term::ProgressBar::IO (DON) + +2.14 2013-07-21 13:34:52 - Document the term_width argument to the constructor (OVID) - Add a "silent" option to the constructor (OVID) -2.13 Fri May 18 06:24:42 2012 +2.13 2012-05-18 06:24:42 - remove unused and invalid SIGNATURE file - move content of BUGS to Changes - Remove the INSTALL and configure files, people should use the standard CPAN installation tools - Add standard prerequisites to Makefile.PL - -2.12 Wed May 16 12:47:16 2012 +2.12 2012-05-16 12:47:16 - use strict; use warnings; in examples - remove bareword from POD (JBAKER) - make lbrack and rbrack official. -2.11 Fri Feb 17 12:31:04 2012 +2.11 2012-02-17 12:31:04 - skip the signature verification -2.10 Wed Dec 21 11:18:26 2011 +2.10 2011-12-21 11:18:26 - remove Build.PL (keep the Makefile.PL only) - Replace home-made testing tools with CPAN-ish tools - Require Capture::Tiny for testing - New co-maintainer: Gabor Szabo -2.09 Sun Mar 13 9:17 PM GMT 2005 +2.09 2005-03-13 21:17 GMT - Fix for incorrect formatting of 'D...' time done at end -2.08 Sat Mar 12 11:47 AM GMT 2005 +2.08 2005-03-12 11:47 GMT - Add remove option - Add patch to account for weird terminal sizing under Windoze (thanks to Andrew Peters for the patch). -2.07 Sun Mar 6 1:31 PM GMT 2005 +2.07 2005-03-06 13:31 GMT - Correct handling of non-term mode to output stats but no PB - Print time taken to complete in ETA mode when Done - Add use of 'name' to example in 'new' doc - Add doc of use of minor characters to description - Add doc. for name value to new -2.06 Sun Mar 14 10:46 AM GMT 2004 +2.06 2004-03-14 10:46 GMT - Add patch to cope when terminal size cannot be detected or is too small. Thanks to Ed Avis (<ed at membled dot com>) for the patch. @@ -53,38 +55,39 @@ - Add patch to suppress unnecessary terminal updates Thanks to Ed Avis (<ed at membled dot com>) for the patch. -2.05 Sat Aug 30 4:23 PM GMT 2003 +2.05 2003-08-30 16:23 GMT - Fix test.pm to handle OS (e.g., Solaris) who refuse to delete the cwd -2.04 Sat Aug 14 4:38 PM GMT 2003 +2.04 2003-08-14 16:38 GMT - Change build system to accomodate CPAN & automated tests -2.03 Sat Jan 11 3:47 PM GMT 2003 +2.03 2003-01-11 15:47 GMT - Fix incorrect reset of progress bar in message method Thanks to Frank Maas (<frank dot maas at cheiron-it dot nl>) for the patch. - Improve documentation of ETA display formats. -2.02 Tue Nov 19 10:08 PM GMT 2002 +2.02 2002-11-19 10:08 GMT - Fix behaviour in terminals where GetTerminalSize fails (e.g., resized Emacs term windows). Thanks to Ed Avis for the patch. -2.01 Mon Oct 7 9:12 PM GMT 2002 +2.01 2002-10-07 21:12 GMT - Make it 5.005_03-compatible, with thanks to Ed Avis -2.00 Sun Mar 10 5:26 AM GMT 2002 +2.00 2002-03-10 05:26 GMT - New API added; now takes one hashref as argument (see docs) - v1 API remains, but is deprecated - Add message method to Term::ProgressBar - Add v2 tests -1.51 Sun Dec 2 12:22 PM GMT 2001 +1.51 2001-12-02 12:22 GMT - Correct Bug #001 Wrong minor character (= should be *) selected by default. -1.50 Sat Dec 1 1:11 PM GMT 2001 +1.50 2001-12-01 13:11 GMT - Merged with Utility::Progress by Martyn J. Pearce -1.00 Mon Oct 30 2001 +1.00 2001-10-30 - original version - by Edward Avis, <epa98 at sync32> + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Term-ProgressBar-2.14/MANIFEST new/Term-ProgressBar-2.15/MANIFEST --- old/Term-ProgressBar-2.14/MANIFEST 2013-07-21 12:36:33.000000000 +0200 +++ new/Term-ProgressBar-2.15/MANIFEST 2014-04-13 22:42:59.000000000 +0200 @@ -7,14 +7,17 @@ examples/simple_use.pl examples/smooth_bar.pl lib/Term/ProgressBar.pm +lib/Term/ProgressBar/IO.pm Makefile.PL MANIFEST This list of files MANIFEST.SKIP META.yml README +t/02_term_progressbar_io.t t/compat.t t/eta-linear.t t/name.t +t/random_file t/silent.t t/v1-message.t t/v2-message.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Term-ProgressBar-2.14/META.json new/Term-ProgressBar-2.15/META.json --- old/Term-ProgressBar-2.14/META.json 2013-07-21 12:36:33.000000000 +0200 +++ new/Term-ProgressBar-2.15/META.json 2014-04-13 22:42:58.000000000 +0200 @@ -4,7 +4,7 @@ "Martyn J. Pearce" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 6.64, CPAN::Meta::Converter version 2.131560", + "generated_by" : "ExtUtils::MakeMaker version 6.82, CPAN::Meta::Converter version 2.132830", "license" : [ "perl_5" ], @@ -49,5 +49,5 @@ "url" : "https://github.com/szabgab/Term-ProgressBar" } }, - "version" : "2.14" + "version" : "2.15" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Term-ProgressBar-2.14/META.yml new/Term-ProgressBar-2.15/META.yml --- old/Term-ProgressBar-2.14/META.yml 2013-07-21 12:36:33.000000000 +0200 +++ new/Term-ProgressBar-2.15/META.yml 2014-04-13 22:42:58.000000000 +0200 @@ -10,7 +10,7 @@ configure_requires: ExtUtils::MakeMaker: 0 dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 6.64, CPAN::Meta::Converter version 2.131560' +generated_by: 'ExtUtils::MakeMaker version 6.82, CPAN::Meta::Converter version 2.132830' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -28,4 +28,4 @@ Term::ReadKey: 2.14 resources: repository: https://github.com/szabgab/Term-ProgressBar -version: 2.14 +version: 2.15 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Term-ProgressBar-2.14/lib/Term/ProgressBar/IO.pm new/Term-ProgressBar-2.15/lib/Term/ProgressBar/IO.pm --- old/Term-ProgressBar-2.14/lib/Term/ProgressBar/IO.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/Term-ProgressBar-2.15/lib/Term/ProgressBar/IO.pm 2014-04-13 22:37:54.000000000 +0200 @@ -0,0 +1,162 @@ +# This program is free software; you can redistribute it and/or +# modify it under the same terms as Perl itself. +# Copyright 2014 by Don Armstrong <don@donarmstrong.com>. + +package Term::ProgressBar::IO; + +=head1 NAME + +Term::ProgressBar::IO -- Display a progress bar while reading from a seekable filehandle + +=head1 SYNOPSIS + + my $pb = Term::ProgressBar::IO->new($fh); + + while (<$fh>) { + # do something + $pb->update(); + } + +=head1 DESCRIPTION + +Displays a progress bar using L<Term::ProgressBar> which corresponds +to reading from a filehandle. + +This module inherits from L<Term::ProgressBar> and has all of its +options. + +=head1 BUGS + +None known. + +=cut + +use warnings; +use strict; +use vars qw($VERSION $DEBUG); + +use parent qw(Term::ProgressBar); +use Carp; +use Fcntl qw(:seek); + +BEGIN{ + $VERSION = q(2.15); + $DEBUG = 0 unless defined $DEBUG; +} + +=head1 METHODS + +=head2 new + +Create and return a new Term::ProgressBar::IO instance. + +=over + +=item ARGUMENTS + +=over + +=item count + +A valid filehandle or item count. L<IO::Uncompress> filehandles are +also properly handled. + +=item OTHER ARGUMENTS + +All other arguments are documented in L<Term::ProgressBar> + +=back + +=back + +=cut + +sub init { + my $self = shift; + my $count; + if (@_==2) { + $count = $_[1]; + } else { + croak + sprintf("Term::ProgressBar::IO::new We don't handle this many arguments: %d", + scalar @_) + if @_ != 1; + } + my %config; + if ( UNIVERSAL::isa ($_[0], 'HASH') ) { + ($count) = @{$_[0]}{qw(count)}; + %config = %{$_[0]}; + } else { + ($count) = @_; + } + if (ref($count) and $count->can("seek")) { + $self->{__filehandle} = $count; + $count = $self->__determine_max(); + } + $config{count} = $count; + $self->SUPER::init(\%config); +} + +=head2 update + +Automatically update the progress bar based on the position of the +filehandle given at construction time. + +=over + +=item ARGUMENTS + +=over + +=item so_far + +Current progress point; this defaults to the current position of the +filehandle. [You probably don't actually want to ever give this.] + +=back + +=back + +=cut + +sub update { + my $self = shift; + my $count = $self->__determine_count(); + $self->SUPER::update(scalar @_? @_ : $count); +} + +sub __determine_max { + my $self = shift; + # is this an IO::Uncompress handle? + my $max = 0; + if ($self->{__filehandle}->can('getHeaderInfo')) { + $self->{__filehandle} = *$self->{__filehandle}{FH}; + } + eval { + my $cur_pos = $self->{__filehandle}->tell; + $self->{__filehandle}->seek(0,SEEK_END); + $max = $self->{__filehandle}->tell; + $self->{__filehandle}->seek($cur_pos,SEEK_SET); + }; + return $max; +} + +sub __determine_count { + my $self = shift; + my $count = 0; + eval { + $count = $self->{__filehandle}->tell; + }; + return $count; +} + +1; + + +__END__ + + + + + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Term-ProgressBar-2.14/lib/Term/ProgressBar.pm new/Term-ProgressBar-2.15/lib/Term/ProgressBar.pm --- old/Term-ProgressBar-2.14/lib/Term/ProgressBar.pm 2013-07-21 12:34:08.000000000 +0200 +++ new/Term-ProgressBar-2.15/lib/Term/ProgressBar.pm 2014-04-13 22:40:16.000000000 +0200 @@ -253,7 +253,7 @@ use vars qw($PACKAGE $VERSION); $PACKAGE = 'Term-ProgressBar'; -$VERSION = '2.14'; +$VERSION = '2.15'; # ---------------------------------- # CLASS CONSTRUCTION @@ -971,7 +971,7 @@ =head1 REPORTING BUGS -via RT: L<https://rt.cpan.org/Dist/Display.html?Name=Pipe> +via RT: L<https://rt.cpan.org/Dist/Display.html?Name=Term-ProgressBar> =head1 COMPATIBILITY @@ -989,7 +989,7 @@ =head1 MAINTAINER -Gabor Szabo L<http://szabgab.com/> +Gabor Szabo L<http://szabgab.com/> L<http://perlmaven.com/> =head1 COPYRIGHT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Term-ProgressBar-2.14/t/02_term_progressbar_io.t new/Term-ProgressBar-2.15/t/02_term_progressbar_io.t --- old/Term-ProgressBar-2.14/t/02_term_progressbar_io.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Term-ProgressBar-2.15/t/02_term_progressbar_io.t 2014-04-13 22:35:56.000000000 +0200 @@ -0,0 +1,32 @@ +# -*- mode: cperl; -*- +use Test::More; + +use_ok('Term::ProgressBar::IO'); + +use IO::File; +use Capture::Tiny qw(capture_stderr); + +my $fh = IO::File->new('t/random_file','r') or + die "Unable to open t/random_file for reading: $!"; + +Term::ProgressBar->__force_term (50); + +my $pb; +my $err = capture_stderr { + $pb = Term::ProgressBar::IO->new($fh); +}; + +ok($pb->target() == 9*2+3,'Correct number of bytes in __DATA__'); + +while (<$fh>) { + $err = capture_stderr { + $pb->update(); + }; +} + +print STDERR $pb->last_update(); +ok($pb->last_update() == $pb->target(),'Last position is now target'); + +close($fh); + +done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Term-ProgressBar-2.14/t/random_file new/Term-ProgressBar-2.15/t/random_file --- old/Term-ProgressBar-2.14/t/random_file 1970-01-01 01:00:00.000000000 +0100 +++ new/Term-ProgressBar-2.15/t/random_file 2014-04-13 22:35:56.000000000 +0200 @@ -0,0 +1,10 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de