[libimage-sane-perl] 01/10: New upstream version 0.14
gregor herrmann
gregoa at debian.org
Sat Jul 15 18:23:04 UTC 2017
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to branch master
in repository libimage-sane-perl.
commit ae08c471f866137c7f40b7b911898987482ab9dd
Author: gregor herrmann <gregoa at debian.org>
Date: Sat Jul 15 19:48:44 2017 +0200
New upstream version 0.14
---
Changes | 20 +++++++++++++++++++-
META.json | 10 ++++++----
META.yml | 6 ++++--
Makefile.PL | 19 ++++++++++++-------
examples/scanimage-perl | 47 ++++++++++++++++++++++++++++++++++++-----------
lib/Image/Sane.pm | 4 ++--
saneperl.h | 2 +-
t/81_scanimage-perl.t | 13 +++++++++++--
t/90_MANIFEST.t | 43 +++++++++++++++++++++++++++++--------------
9 files changed, 120 insertions(+), 44 deletions(-)
diff --git a/Changes b/Changes
index c70ee9e..c1d024e 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,24 @@
Revision history for Perl extension Image::Sane.
-0.09 Mon, 25 May 2017 17:30 +0200
+0.14 Thu, 08 Jul 2017 19:30 +0200
+ - correct escaping in 81_scanimage-perl.t to fix RT 122380.
+ - add Try::Tiny to TEST_REQUIRES fix RT 122382.
+
+0.13 Thu, 06 Jul 2017 19:30 +0200
+ - include <sane/saneopts.h> to fix RT 122333.
+ - update scanimage-perl to also reproduce scanimage 1.0.27.
+ Fixes RT 122334
+
+0.12 Sun, 04 Jun 2017 09:30 +0200
+ - skip t/81_scanimage-perl.t if we don't have Perl 5.10
+
+0.11 Wed, 31 May 2017 18:30 +0200
+ - remove postamble from Makefile.PL if OS is not linux to fix RT 121936.
+
+0.10 Mon, 29 May 2017 17:30 +0200
+ - skip scanimage tests if not installed to fix RT 121922.
+
+0.09 Thu, 25 May 2017 17:30 +0200
- Use identify -format to fix spurious test failures
- + missing PREREQ_PM and CONFIGURE_REQUIRES to fix RT 121871.
diff --git a/META.json b/META.json
index 5c92402..2cec0d3 100644
--- a/META.json
+++ b/META.json
@@ -23,8 +23,9 @@
"build" : {
"requires" : {
"ExtUtils::MakeMaker" : "0",
- "Readonly" : "0",
- "Test::More" : "0"
+ "Test::More" : "0",
+ "Test::Requires" : "0",
+ "Try::Tiny" : "0"
}
},
"configure" : {
@@ -35,11 +36,12 @@
},
"runtime" : {
"requires" : {
- "Exception::Class" : "0"
+ "Exception::Class" : "0",
+ "Readonly" : "0"
}
}
},
"release_status" : "stable",
- "version" : "0.09",
+ "version" : "0.14",
"x_serialization_backend" : "JSON::PP version 2.27300_01"
}
diff --git a/META.yml b/META.yml
index 22881af..89d2e1e 100644
--- a/META.yml
+++ b/META.yml
@@ -4,8 +4,9 @@ author:
- 'Jeffrey Ratcliffe'
build_requires:
ExtUtils::MakeMaker: '0'
- Readonly: '0'
Test::More: '0'
+ Test::Requires: '0'
+ Try::Tiny: '0'
configure_requires:
ExtUtils::Depends: '0'
ExtUtils::PkgConfig: '0'
@@ -22,5 +23,6 @@ no_index:
- inc
requires:
Exception::Class: '0'
-version: '0.09'
+ Readonly: '0'
+version: '0.14'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff --git a/Makefile.PL b/Makefile.PL
index 655f34e..904f153 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -2,6 +2,7 @@ use 5.008;
use ExtUtils::MakeMaker;
use ExtUtils::Depends;
use ExtUtils::PkgConfig;
+use English;
# minimum required version of dependancies we need to build
our %build_reqs = ( 'libsane' => '1.0.19', );
@@ -28,16 +29,17 @@ if (
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
- NAME => 'Image::Sane',
- VERSION_FROM => 'lib/Image/Sane.pm', # finds $VERSION
- PREREQ_PM => { Exception::Class => 0 },
+ NAME => 'Image::Sane',
+ VERSION_FROM => 'lib/Image/Sane.pm', # finds $VERSION
+ PREREQ_PM => { Readonly => 0, Exception::Class => 0 },
CONFIGURE_REQUIRES => {
ExtUtils::Depends => 0,
ExtUtils::PkgConfig => 0
},
TEST_REQUIRES => {
- Test::More => 0,
- Readonly => 0,
+ Test::More => 0,
+ Test::Requires => 0,
+ Try::Tiny => 0,
},
clean => { FILES => '$(SOURCE_TIDY)' },
@@ -61,7 +63,11 @@ WriteMakefile(
);
sub MY::postamble {
- my $postamble = <<'END';
+
+ # GNU Make extensions that BSD make doesn't like.
+ # Author-only stuff, so comment out for non-Linux.
+ if ( $OSNAME ne 'linux' ) { return }
+ return <<'END';
SHELL = bash
MANIFEST = $(shell cat MANIFEST)
SOURCE = $(filter bin/% examples/% %.pm %.PL %.pl %.t,$(MANIFEST))
@@ -75,5 +81,4 @@ tidy : MANIFEST $(SOURCE_TIDY)
%.tdy : %
perltidy $* && if ! diff -q $@ $* > /dev/null; then cp $@ $*; fi
END
- $postamble;
}
diff --git a/examples/scanimage-perl b/examples/scanimage-perl
index d55978f..0579a4a 100755
--- a/examples/scanimage-perl
+++ b/examples/scanimage-perl
@@ -24,9 +24,11 @@ Readonly my $MAXVAL_8_BIT => 2**$_8_BIT - 1;
Readonly my $_16_BIT => 16;
Readonly my $MAXVAL_16_BIT => 2**$_16_BIT - 1;
Readonly my $HUNDRED => 100.;
-Readonly my $INFINITE => -1;
+Readonly my $THOUSAND => 1000.;
+Readonly my $INFINITY => -1;
Readonly my $I_TL_Y => 3;
Readonly my $RGB_FRAMES => 3;
+Readonly my $_1_0_25 => 1.000025;
#$Image::Sane::DEBUG = 1;
@@ -57,7 +59,10 @@ my $status = SANE_STATUS_GOOD;
my $SPACE = q{ };
my $EMPTY = q{};
my $DASH = q{-};
-my @args = (
+my @version = Image::Sane->get_version;
+my $version =
+ $version[0] + $version[1] / $THOUSAND + $version[2] / $THOUSAND / $THOUSAND;
+my @args = (
\%options,
'd|device-name=s' => \$devname,
'L|list-devices',
@@ -432,7 +437,7 @@ sub parse_scalar {
sub parse_vector {
my ( $opt, $str ) = @_;
- my $index = $INFINITE;
+ my $index = $INFINITY;
my $prev_value = 0;
my $prev_index = 0;
my $separator = $EMPTY;
@@ -734,7 +739,7 @@ sub scan_it {
my @format_name = qw( gray RGB red green blue );
my $total_bytes = 0;
- # my $hang_over = $INFINITE;
+ # my $hang_over = $INFINITY;
my $parm;
while (1) {
@@ -989,7 +994,7 @@ sub buffer_data { ## no critic (ProhibitManyArgs)
# if ($len > 0) {
# printstdout($buffer);
# $buffer = $hang_over.$buffer;
- # $hang_over = $INFINITE;
+ # $hang_over = $INFINITY;
# $start = 1;
# }
# }
@@ -1067,10 +1072,24 @@ sub log_batch_scan {
# }
}
- printstderr(
- sprintf
- "Scanning %d pages, incrementing by %d, numbering from %d\n",
- $batch_count, $batch_increment, $batch_start_at );
+ if ( $version > $_1_0_25 ) {
+ my $plural = $batch_count == 1 ? $EMPTY : 's';
+ if ( $batch_count == $INFINITY ) {
+ printstderr( sprintf 'Scanning infinity ' );
+ }
+ else {
+ printstderr( sprintf 'Scanning %d ', $batch_count );
+ }
+ printstderr(
+ sprintf "page%s, incrementing by %d, numbering from %d\n",
+ $plural, $batch_increment, $batch_start_at );
+ }
+ else {
+ printstderr(
+ sprintf
+ "Scanning %d pages, incrementing by %d, numbering from %d\n",
+ $batch_count, $batch_increment, $batch_start_at );
+ }
}
return;
}
@@ -1173,6 +1192,12 @@ sub scan_pages {
if ( not ok_for_next_page() ) { last }
}
+ if ( $batch and $version > $_1_0_25 ) {
+ printstderr(
+ sprintf "Batch terminated, %d pages scanned\n",
+ ( $n - $batch_start_at ) / $batch_increment
+ );
+ }
try {
$device->cancel;
@@ -1183,7 +1208,7 @@ sub scan_pages {
sub ok_for_next_page {
return (
- $batch and ( $batch_count == $INFINITE
+ $batch and ( $batch_count == $INFINITY
or --$batch_count )
and ($status == SANE_STATUS_GOOD
or $status == SANE_STATUS_EOF )
@@ -1646,7 +1671,7 @@ if ($batch_count) {
$batch = 1;
}
elsif ($batch) {
- $batch_count = $INFINITE;
+ $batch_count = $INFINITY;
}
else {
$batch_count = 1;
diff --git a/lib/Image/Sane.pm b/lib/Image/Sane.pm
index 7fda9f3..67657e3 100644
--- a/lib/Image/Sane.pm
+++ b/lib/Image/Sane.pm
@@ -136,7 +136,7 @@ our %EXPORT_TAGS = (
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-our $VERSION = '0.09';
+our $VERSION = '0.14';
our $DEBUG = 0;
my $vc;
@@ -200,7 +200,7 @@ Project
=head1 VERSION
-0.07
+0.14
=head1 SYNOPSIS
diff --git a/saneperl.h b/saneperl.h
index d57cc2b..24ef88f 100644
--- a/saneperl.h
+++ b/saneperl.h
@@ -12,6 +12,6 @@
/* Include all of sane's headers for internal consistency */
#include <sane/sane.h>
/*#include "sane/sanei.h"*/
-#include "sane/saneopts.h"
+#include <sane/saneopts.h>
#endif /* _SANEPERL_H_ */
diff --git a/t/81_scanimage-perl.t b/t/81_scanimage-perl.t
index 6cb1230..f239d7a 100644
--- a/t/81_scanimage-perl.t
+++ b/t/81_scanimage-perl.t
@@ -1,12 +1,21 @@
use warnings;
use strict;
use English;
-use Test::More tests => 6;
+use Test::More;
+use Test::Requires qw( v5.10 );
#########################
+if ( system("which scanimage > /dev/null 2> /dev/null") == 0 ) {
+ plan tests => 6;
+}
+else {
+ plan skip_all => 'scanimage not installed';
+ exit;
+}
+
my $scanimage_perl =
- 'PERL5LIB="blib:blib/arch:lib:\$PERL5LIB" '
+ 'PERL5LIB="blib:blib/arch:lib:$PERL5LIB" '
. "$EXECUTABLE_NAME examples/scanimage-perl";
my $identify = "; identify -format '%m %G %g %z-bit %r' out*.pnm; rm out*.pnm";
diff --git a/t/90_MANIFEST.t b/t/90_MANIFEST.t
index bc094c5..2765ec7 100644
--- a/t/90_MANIFEST.t
+++ b/t/90_MANIFEST.t
@@ -1,21 +1,36 @@
use strict;
use warnings;
-use Test::More;
+use English;
+use Image::Sane ':all';
+use Test::More tests => 2;
my $git;
-if (
- -d '.git'
- and
- eval { $git = `git ls-tree --name-status -r HEAD | egrep -v '^\.(git|be)'` }
- )
-{
- plan( tests => 1 );
-}
-else {
- my $msg = 'Need the git repository to compare the MANIFEST.';
- plan( skip_all => $msg );
+SKIP: {
+ skip 'Need the git repository to compare the MANIFEST.', 1
+ unless (
+ -d '.git'
+ and eval {
+ $git = `git ls-tree --name-status -r HEAD | egrep -v '^\.(git|be)'`;
+ }
+ );
+
+ my $manifest = `cat MANIFEST`;
+
+ ok( $git eq $manifest, 'MANIFEST up to date' );
}
-my $manifest = `cat MANIFEST`;
+local $INPUT_RECORD_SEPARATOR = undef;
+my $file = 'lib/Image/Sane.pm';
+open my $fh, '<:encoding(UTF8)', $file
+ or die "Error: cannot open $file\n";
+my $text = <$fh>;
+close $fh or die "Error: cannot close $file\n";
-ok( $git eq $manifest, 'MANIFEST up to date' );
+if ( $text =~ /=head1\s+VERSION\s+([0-9][.][0-9]+)/xsm ) {
+ my $version = $1;
+ is( $version, $Image::Sane::VERSION,
+ 'version number correctly documented' );
+}
+else {
+ fail 'version string not found';
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libimage-sane-perl.git
More information about the Pkg-perl-cvs-commits
mailing list