On 2016-02-07 17:33:53, ron@savage.net.au wrote:
Show quoted text> Hi Slaven
>
> Agggghhh. No! The original code was correct. Tests fail with your patch.
> But after undoing it, tests fall with a 'mv' error. I have to start
> $work now, it's 9:30am.
>
Probably you missed the last line in my proposal or so. Please see the attached patch. Tests pass on my system, even with a problematic build dir.
From ed8405e62399a4eed9e938271061213aa86b3224 Mon Sep 17 00:00:00 2001
From: Slaven Rezic <slaven@rezic.de>
Date: Tue, 9 Feb 2016 06:27:51 +0000
Subject: [PATCH] fix for RT #111844
---
lib/Data/Session.pm | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/lib/Data/Session.pm b/lib/Data/Session.pm
index 596d0ae..a934af6 100644
--- a/lib/Data/Session.pm
+++ b/lib/Data/Session.pm
@@ -280,8 +280,7 @@ sub flush
sub get_my_drivers
{
my($self) = @_;
- my($path) = File::Spec -> catdir($INC{'Data/Session.pm'}, 'Driver');
- $path =~ s/.pm//;
+ my $path = _get_pm_path('Driver');
# Warning: Use sort map{} read_dir, not map{} sort read_dir. But, why?
@@ -300,8 +299,7 @@ sub get_my_drivers
sub get_my_id_generators
{
my($self) = @_;
- my($path) = File::Spec -> catdir($INC{'Data/Session.pm'}, 'ID');
- $path =~ s/.pm//;
+ my $path = _get_pm_path('ID');
# Warning: Use sort map{} read_dir, not map{} sort read_dir. But, why?
@@ -320,8 +318,7 @@ sub get_my_id_generators
sub get_my_serializers
{
my($self) = @_;
- my($path) = File::Spec -> catdir($INC{'Data/Session.pm'}, 'Serialize');
- $path =~ s/.pm//;
+ my $path = _get_pm_path('Serialize');
# Warning: Use sort map{} read_dir, not map{} sort read_dir. But, why?
@@ -906,6 +903,15 @@ sub validate_time
# -----------------------------------------------
+sub _get_pm_path {
+ my $subdir = shift;
+ my($path) = $INC{'Data/Session.pm'};
+ $path =~ s/\.pm$//;
+ return File::Spec -> catdir($path, $subdir);
+}
+
+# -----------------------------------------------
+
1;
=pod
--
1.7.10.4