summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Ragwitz <rafl@debian.org>2010-12-10 00:08:42 +0100
committerFlorian Ragwitz <rafl@debian.org>2010-12-11 17:54:29 +0100
commitd6f31ecf904f01f8a2aab2bca55e33b1b51e0b4d (patch)
tree79675cb0381bfd58dcee8d5e02b524ba01944b3b
parent8172cd69ba298e1a50dd0f1f791202b524bc3a66 (diff)
downloadperl-d6f31ecf904f01f8a2aab2bca55e33b1b51e0b4d.tar.gz
Dual-life File::CheckTree
-rw-r--r--MANIFEST4
-rwxr-xr-xPorting/Maintainers.pl9
-rw-r--r--dist/File-CheckTree/lib/File/CheckTree.pm (renamed from lib/File/CheckTree.pm)6
-rw-r--r--dist/File-CheckTree/t/CheckTree.t (renamed from lib/File/CheckTree.t)73
-rw-r--r--lib/.gitignore1
5 files changed, 46 insertions, 47 deletions
diff --git a/MANIFEST b/MANIFEST
index 4005645436..7a017fc4da 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -2744,6 +2744,8 @@ dist/ExtUtils-ParseXS/t/XSTest.pm Test file for ExtUtils::ParseXS tests
dist/ExtUtils-ParseXS/t/XSTest.xs Test file for ExtUtils::ParseXS tests
dist/ExtUtils-ParseXS/t/XSUsage.pm ExtUtils::ParseXS tests
dist/ExtUtils-ParseXS/t/XSUsage.xs ExtUtils::ParseXS tests
+dist/File-CheckTree/lib/File/CheckTree.pm Perl module supporting wholesale file mode validation
+dist/File-CheckTree/t/CheckTree.t See if File::CheckTree works
dist/Filter-Simple/lib/Filter/Simple.pm Simple frontend to Filter::Util::Call
dist/Filter-Simple/t/data.t See if Filter::Simple works
dist/Filter-Simple/t/export.t See if Filter::Simple works
@@ -3700,8 +3702,6 @@ lib/feature.t See if features work
lib/feature/unicode_strings.t See if feature "unicode_strings" work
lib/File/Basename.pm Emulate the basename program
lib/File/Basename.t See if File::Basename works
-lib/File/CheckTree.pm Perl module supporting wholesale file mode validation
-lib/File/CheckTree.t See if File::CheckTree works
lib/File/Compare.pm Emulation of cmp command
lib/File/Compare.t See if File::Compare works
lib/File/Copy.pm Emulation of cp command
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index cf7a800ce6..e1dbec5417 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -641,6 +641,14 @@ use File::Glob qw(:case);
'UPSTREAM' => undef,
},
+ 'File::CheckTree' =>
+ {
+ 'MAINTAINER' => 'p5p',
+ 'DISTRIBUTION' => 'FLORA/File-CheckTree-4.4.tar.gz',
+ 'FILES' => q[dist/File-CheckTree],
+ 'UPSTREAM' => 'blead',
+ },
+
'File::Fetch' =>
{
'MAINTAINER' => 'kane',
@@ -1722,7 +1730,6 @@ use File::Glob qw(:case);
lib/ExtUtils/t/Embed.t
lib/ExtUtils/typemap
lib/File/Basename.{pm,t}
- lib/File/CheckTree.{pm,t}
lib/File/Compare.{pm,t}
lib/File/Copy.{pm,t}
lib/File/DosGlob.{pm,t}
diff --git a/lib/File/CheckTree.pm b/dist/File-CheckTree/lib/File/CheckTree.pm
index d7948f2385..bc072f4a84 100644
--- a/lib/File/CheckTree.pm
+++ b/dist/File-CheckTree/lib/File/CheckTree.pm
@@ -119,7 +119,7 @@ sub validate {
my $this = $test;
# expand relative $file to full pathname if preceded by cd directive
- $file = File::Spec->catfile($cwd, $file)
+ $file = File::Spec->catfile($cwd, $file)
if $cwd && !File::Spec->file_name_is_absolute($file);
# put filename in after the test operator
@@ -137,7 +137,7 @@ sub validate {
}
else {
# add "|| warn" as a default disposition
- $this .= ' || warn' unless $this =~ /\|\|/;
+ $this .= ' || warn' unless $this =~ /\|\|/;
# change a generic ".. || die" or ".. || warn"
# to call valmess instead of die/warn directly
@@ -163,7 +163,7 @@ sub validate {
# do the test
eval $this;
- # re-raise an exception caused by a "... || die" test
+ # re-raise an exception caused by a "... || die" test
if (my $err = $@) {
# in case of any cd directives, return from whence we came
if ($starting_dir ne cwd) {
diff --git a/lib/File/CheckTree.t b/dist/File-CheckTree/t/CheckTree.t
index 1548a0ff8b..d12d60cb02 100644
--- a/lib/File/CheckTree.t
+++ b/dist/File-CheckTree/t/CheckTree.t
@@ -1,13 +1,5 @@
#!./perl -w
-BEGIN {
- chdir 't' if -d 't';
-
- # We will shortly chdir .., so '../lib' will be wrong at that time, and
- # 'lib' will be correct
- @INC = ('../lib', 'lib');
-}
-
use Test::More tests => 23;
use strict;
@@ -17,19 +9,18 @@ require overload;
use File::CheckTree;
use File::Spec; # used to get absolute paths
-# We assume that we start from the perl "t" directory.
-# Will move up one level to make it easier to generate
-# reliable pathnames for testing File::CheckTree
-
-chdir(File::Spec->updir) or die "cannot change to parent of t/ directory: $!";
+# We assume that we start from the dist/File-CheckTree in the perl repository,
+# or the dist root directory for the CPAN version.
#### TEST 1 -- No warnings ####
# usings both relative and full paths, indented comments
{
- my ($num_warnings, $path_to_README);
- $path_to_README = File::Spec->rel2abs('README');
+ my ($num_warnings, $path_to_libFileCheckTree);
+ $path_to_libFileCheckTree = File::Spec->rel2abs(
+ File::Spec->catfile('lib', 'File', 'CheckTree.pm'),
+ );
my @warnings;
local $SIG{__WARN__} = sub { push @warnings, "@_" };
@@ -38,11 +29,11 @@ chdir(File::Spec->updir) or die "cannot change to parent of t/ directory: $!";
$num_warnings = validate qq{
lib -d
# comment, followed "blank" line (w/ whitespace):
-
+
# indented comment, followed blank line (w/o whitespace):
- README -f
- '$path_to_README' -e || warn
+ lib/File/CheckTree.pm -f
+ '$path_to_libFileCheckTree' -e || warn
};
};
@@ -63,7 +54,7 @@ chdir(File::Spec->updir) or die "cannot change to parent of t/ directory: $!";
eval {
$num_warnings = validate qq{
lib -f
- README -f
+ lib/File/CheckTree.pm -f
};
};
@@ -86,8 +77,8 @@ chdir(File::Spec->updir) or die "cannot change to parent of t/ directory: $!";
eval {
$num_warnings = validate q{
lib -effd
- README -f || die
- README -d || warn
+ lib/File/CheckTree.pm -f || die
+ lib/File/CheckTree.pm -d || warn
lib -f || warn "my warning: $file\n"
};
};
@@ -95,7 +86,7 @@ chdir(File::Spec->updir) or die "cannot change to parent of t/ directory: $!";
is( $@, '' );
is( scalar @warnings, 3 );
like( $warnings[0], qr/lib is not a plain file/);
- like( $warnings[1], qr/README is not a directory/);
+ like( $warnings[1], qr{lib/File/CheckTree.pm is not a directory});
like( $warnings[2], qr/my warning: lib/);
is( $num_warnings, 3 );
}
@@ -104,29 +95,29 @@ chdir(File::Spec->updir) or die "cannot change to parent of t/ directory: $!";
#### TEST 4 -- cd directive ####
# cd directive followed by relative paths, followed by full paths
{
- my ($num_warnings, @warnings, $path_to_libFile, $path_to_dist);
- $path_to_libFile = File::Spec->rel2abs(File::Spec->catdir('lib','File'));
- $path_to_dist = File::Spec->rel2abs(File::Spec->curdir);
+ my ($num_warnings, @warnings, $path_to_lib, $path_to_dist);
+ $path_to_lib = File::Spec->rel2abs(File::Spec->catdir('lib'));
+ $path_to_dist = File::Spec->rel2abs(File::Spec->curdir);
local $SIG{__WARN__} = sub { push @warnings, "@_" };
eval {
$num_warnings = validate qq{
- lib -d || die
- '$path_to_libFile' cd
- Spec -e
- Spec -f
- '$path_to_dist' cd
- README -ef
- INSTALL -d || warn
- '$path_to_libFile' -d || die
+ lib -d || die
+ '$path_to_lib' cd
+ File -e
+ File -f
+ '$path_to_dist' cd
+ lib/File/CheckTree.pm -ef
+ lib/File/CheckTree.pm -d || warn
+ '$path_to_lib' -d || die
};
};
is( $@, '' );
is( scalar @warnings, 2 );
- like( $warnings[0], qr/Spec is not a plain file/);
- like( $warnings[1], qr/INSTALL is not a directory/);
+ like( $warnings[0], qr/File is not a plain file/);
+ like( $warnings[1], qr/CheckTree\.pm is not a directory/);
is( $num_warnings, 2 );
}
@@ -138,8 +129,8 @@ chdir(File::Spec->updir) or die "cannot change to parent of t/ directory: $!";
eval {
$num_warnings = validate q{
- lib -ef || die
- README -d
+ lib -ef || die
+ lib/File/CheckTree.pm -d
};
};
@@ -154,8 +145,8 @@ chdir(File::Spec->updir) or die "cannot change to parent of t/ directory: $!";
eval {
$num_warnings = validate q{
- lib -ef || die "yadda $file yadda...\n"
- README -d
+ lib -ef || die "yadda $file yadda...\n"
+ lib/File/CheckTree.pm -d
};
};
@@ -185,6 +176,6 @@ chdir(File::Spec->updir) or die "cannot change to parent of t/ directory: $!";
};
};
- like( $@, qr/syntax error/,
- 'We got a syntax error for a malformed file query' );
+ like( $@, qr/syntax error/,
+ 'We got a syntax error for a malformed file query' );
}
diff --git a/lib/.gitignore b/lib/.gitignore
index 6af10566a2..873e8a40e0 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -172,6 +172,7 @@
/ExtUtils/xsubpp
/Fatal.pm
/Fcntl.pm
+/File/CheckTree.pm
/File/Fetch.pm
/File/Glob.pm
/File/GlobMapper.pm