Skip to content

Commit 0168e42

Browse files
committed
Update Filter-Util-Call to CPAN version 1.57
[DELTA] 1.57 2017-01-22 rurban ---- * Todo the t/exec.t test 2 on cygwin. * Fixed/Todo the t/decrypt.t test 7 utf8 failures. Skip with non UTF-8 locale. 1.56 2017-01-20 rurban ---- * add binmode to the decrypt/encr,decrypt sample scripts * add utf8-encoded testcase to t/decrypt.t [cpan #110921]. use -C * stabilized some tests, add diag to sometimes failing sh tests * moved filter-util.pl to t/ * fixed INSTALLDIRS back to site since 5.12 [gh #2] * fixed exec/sh test races using the same temp. filenames * reversed this Changes file to latest first * added Travis CI
1 parent 393b66e commit 0168e42

File tree

8 files changed

+55
-29
lines changed

8 files changed

+55
-29
lines changed

Porting/Maintainers.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ package Maintainers;
523523
},
524524

525525
'Filter::Util::Call' => {
526-
'DISTRIBUTION' => 'RURBAN/Filter-1.55.tar.gz',
526+
'DISTRIBUTION' => 'RURBAN/Filter-1.57.tar.gz',
527527
'FILES' => q[cpan/Filter-Util-Call
528528
pod/perlfilter.pod
529529
],

cpan/Filter-Util-Call/Call.pm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
# Copyright (c) 1995-2011 Paul Marquess. All rights reserved.
44
# Copyright (c) 2011-2014 Reini Urban. All rights reserved.
5+
# Copyright (c) 2014-2017 cPanel Inc. All rights reserved.
56
#
67
# This program is free software; you can redistribute it and/or
78
# modify it under the same terms as Perl itself.
@@ -14,11 +15,13 @@ require Exporter;
1415
use Carp ;
1516
use strict;
1617
use warnings;
17-
use vars qw($VERSION @ISA @EXPORT) ;
18+
use vars qw($VERSION $XS_VERSION @ISA @EXPORT) ;
1819

1920
@ISA = qw(Exporter DynaLoader);
2021
@EXPORT = qw( filter_add filter_del filter_read filter_read_exact) ;
21-
$VERSION = "1.55" ;
22+
$VERSION = "1.57" ;
23+
$XS_VERSION = $VERSION;
24+
$VERSION = eval $VERSION;
2225

2326
sub filter_read_exact($)
2427
{
@@ -525,6 +528,7 @@ Paul Marquess
525528
526529
Copyright (c) 1995-2011 Paul Marquess. All rights reserved.
527530
Copyright (c) 2011-2014 Reini Urban. All rights reserved.
531+
Copyright (c) 2014-2017 cPanel Inc. All rights reserved.
528532
529533
This program is free software; you can redistribute it and/or
530534
modify it under the same terms as Perl itself.

cpan/Filter-Util-Call/Call.xs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Author : Paul Marquess
55
* Date : 2014-12-09 02:48:44 rurban
6-
* Version : 1.55
6+
* Version : 1.57
77
*
88
* Copyright (c) 1995-2011 Paul Marquess. All rights reserved.
99
* Copyright (c) 2011-2014 Reini Urban. All rights reserved.

cpan/Filter-Util-Call/filter-util.pl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ sub writeFile
3030

3131
sub ok
3232
{
33-
my($number, $result, $note) = @_ ;
33+
my ($number, $result, $note) = @_ ;
3434

3535
$note = "" if ! defined $note ;
3636
if ($note) {
@@ -40,11 +40,17 @@ sub ok
4040

4141
print "not " if !$result ;
4242
print "ok ${number}${note}\n";
43+
return $result;
44+
}
45+
46+
sub diag {
47+
print STDERR
48+
(map { /^#/ ? "$_\n" : "# $_\n" }
49+
map { split /\n/ } @_);
4350
}
4451

4552
$Inc = '' ;
46-
foreach (@INC)
47-
{ $Inc .= "\"-I$_\" " }
53+
foreach (@INC) { $Inc .= "\"-I$_\" " }
4854
$Inc = "-I::lib" if $^O eq 'MacOS';
4955

5056
$Perl = '' ;

cpan/Filter-Util-Call/t/call.t

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
use Config;
12
BEGIN {
2-
if ($ENV{PERL_CORE}){
3-
require Config; import Config;
4-
%Config=%Config if 0; # cease -w
3+
if ($ENV{PERL_CORE}) {
54
if ($Config{'extensions'} !~ m{\bFilter/Util/Call\b}) {
65
print "1..0 # Skip: Filter::Util::Call was not built\n";
76
exit 0;
87
}
98
}
9+
unshift @INC, 't';
1010
require 'filter-util.pl';
1111
}
1212

@@ -23,9 +23,9 @@ use Cwd ;
2323
my $here = getcwd ;
2424

2525

26-
my $filename = "call.tst" ;
27-
my $filename2 = "call2.tst" ;
28-
my $filenamebin = "call.bin" ;
26+
my $filename = "call$$.tst" ;
27+
my $filename2 = "call2$$.tst" ;
28+
my $filenamebin = "call$$.bin" ;
2929
my $module = "MyTest" ;
3030
my $module2 = "MyTest2" ;
3131
my $module3 = "MyTest3" ;
@@ -68,14 +68,27 @@ sub import { filter_add() }
6868
6969
1 ;
7070
EOM
71-
71+
7272
$a = `$Perl "-I." $Inc -e "use ${module} ;" $redir` ;
73-
ok(3, (($? >>8) != 0 or (($^O eq 'MSWin32' || $^O eq 'MacOS' || $^O eq 'NetWare' || $^O eq 'mpeix') && $? != 0))) ;
73+
#warn "# $a\n";
74+
ok(3, (($? >>8) != 0
75+
or (($^O eq 'MSWin32' || $^O eq 'MacOS' || $^O eq 'NetWare' || $^O eq 'mpeix')
76+
&& $? != 0))) ;
7477
#ok(4, $a =~ /^usage: filter_add\(ref\) at ${module}.pm/) ;
75-
ok(4, $a =~ /^Not enough arguments for Filter::Util::Call::filter_add/m) ;
76-
77-
78-
78+
my $errmsg = $Config{usecperl}
79+
? qr/^Not enough arguments for subroutine entry Filter::Util::Call::filter_add at ${module}\.pm line/m
80+
: qr/^Not enough arguments for Filter::Util::Call::filter_add at ${module}\.pm line/m;
81+
$a =~ s/^(.*?\n).*$/$1/s; # only the first line
82+
if ($] < 5.007) {
83+
if ($a =~ $errmsg) {
84+
ok(4, 1);
85+
} else {
86+
ok(4, 1, "TODO");
87+
}
88+
} else {
89+
ok(4, $a =~ $errmsg, 'usage error')
90+
or diag("The error was: ", $a);
91+
}
7992

8093
# non-error cases
8194
#################
@@ -92,9 +105,9 @@ use Filter::Util::Call ;
92105
sub import {
93106
filter_add(
94107
sub {
95-
108+
96109
my ($status) ;
97-
110+
98111
if (($status = filter_read()) > 0) {
99112
s/ABC/DEF/g
100113
}
@@ -214,20 +227,20 @@ sub import { filter_add(
214227
sub
215228
{
216229
my ($status) ;
217-
230+
218231
if (($status = filter_read()) > 0) {
219232
s/Fred/Joe/g
220233
}
221234
$status ;
222235
} ) ;
223236
}
224-
237+
225238
1 ;
226239
EOM
227-
240+
228241
writeFile("${module4}.pm", <<EOM) ;
229242
package ${module4} ;
230-
243+
231244
use $module5 ;
232245
233246
print "I'm feeling used!\n" ;

cpan/Filter-Util-Call/t/rt_101033.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rt_101033;
44

55
print "1..1\n";
66
my $s = <DATA>;
7-
print "not " if $s !~ /^test/;
7+
print "not " if !$s or $s !~ /^test/;
88
print "ok 1 # TODO RT #101033 + Switch #97440 ignores __DATA__\n";
99

1010
__DATA__

cpan/Filter-Util-Call/t/rt_54452-rebless.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ if ($] < 5.004_55) {
88

99
use strict;
1010
use warnings;
11+
BEGIN { unshift @INC, 't'; }
1112

12-
require "./filter-util.pl" ;
13+
require "filter-util.pl" ;
1314

1415
use vars qw( $Inc $Perl) ;
1516

pod/perlfilter.pod

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,11 @@ or the byteloader, to translate binary code back to source code.
562562
See for example the limitations in L<Switch>, which uses source filters,
563563
and thus is does not work inside a string eval, the presence of
564564
regexes with embedded newlines that are specified with raw C</.../>
565-
delimiters and don't have a modifier C</x> are indistinguishable from
565+
delimiters and don't have a modifier C<//x> are indistinguishable from
566566
code chunks beginning with the division operator C</>. As a workaround
567-
you must use C<m/.../> or C<m?...?> for such patterns. See
567+
you must use C<m/.../> or C<m?...?> for such patterns. Also, the presence of
568+
regexes specified with raw C<?...?> delimiters may cause mysterious
569+
errors. The workaround is to use C<m?...?> instead. See
568570
L<http://search.cpan.org/perldoc?Switch#LIMITATIONS>
569571

570572
Currently the content of the C<__DATA__> block is not filtered.

0 commit comments

Comments
 (0)