Package: libur-perl Version: 0.450-1 Tags: patch This package fails to build in a directory with regexp metacharacters like a plus sign ('+').
Test Summary Report ------------------- t/URT/t/70d_command_sub_command_factory.t (Wstat: 768 Tests: 6 Failed: 3) Failed tests: 3-5 Non-zero exit status: 3 t/class_browser/internal.t (Wstat: 65280 Tests: 8 Failed: 2) Failed tests: 2, 8 Non-zero exit status: 255 Parse errors: Bad plan. You planned 38 tests but ran 8. Patch attached. -- Niko Tyni nt...@debian.org
>From 2686c8d1e3c556a40e44a54e41d7d458490080d4 Mon Sep 17 00:00:00 2001 From: Niko Tyni <nt...@debian.org> Date: Sun, 10 Jun 2018 15:45:33 +0300 Subject: [PATCH] Fix test failures when cwd contains regexp metacharacters t/URT/t/70d_command_sub_command_factory.t and t/class_browser/internal.t fail without this when run in a directory containing regexp metacharacters like a plus ('+'). --- lib/Command/SubCommandFactory.pm | 2 +- lib/UR/Namespace/Command/Sys/ClassBrowser.pm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Command/SubCommandFactory.pm b/lib/Command/SubCommandFactory.pm index da1219da..a3bff107 100644 --- a/lib/Command/SubCommandFactory.pm +++ b/lib/Command/SubCommandFactory.pm @@ -61,7 +61,7 @@ sub _build_sub_command_mapping { my @target_class_names; for my $target_path (@target_paths) { my $target = $target_path; - $target =~ s#$base_path\/$ref_path/##; + $target =~ s#\Q$base_path\E\/$ref_path/##; $target =~ s/\.pm//; my $target_base_class = $class->_target_base_class; diff --git a/lib/UR/Namespace/Command/Sys/ClassBrowser.pm b/lib/UR/Namespace/Command/Sys/ClassBrowser.pm index 2ba06a7b..7f9e69b4 100644 --- a/lib/UR/Namespace/Command/Sys/ClassBrowser.pm +++ b/lib/UR/Namespace/Command/Sys/ClassBrowser.pm @@ -200,7 +200,7 @@ sub _generate_class_name_cache { my $cwd = Cwd::getcwd . '/'; my $namespace_meta = $namespace->__meta__; my $namespace_dir = $namespace_meta->module_directory; - (my $path = $namespace_meta->module_path) =~ s/^$cwd//; + (my $path = $namespace_meta->module_path) =~ s/^\Q$cwd\E//; my $by_class_name = { $namespace => { name => $namespace, is => $namespace_meta->is, @@ -226,7 +226,7 @@ sub _class_name_cache_data_for_class_name { } my $namespace_dir = $class_meta->namespace->__meta__->module_directory; my $module_path = $class_meta->module_path; - (my $relpath = $module_path) =~ s/^$namespace_dir//; + (my $relpath = $module_path) =~ s/^\Q$namespace_dir\E//; return { name => $class_meta->class_name, relpath => $relpath, -- 2.17.1