Subject: | process_item goes into infinite loop |
for perl 5.20.1 and App-perlmv CPAN release 0.46 build fails as test goes
[...]
Use of uninitialized value $anew in exists at /usr/src/RPM/BUILD/App-perlmv-0.46/blib/lib/App/perlmv.pm line 450.
Use of uninitialized value $anew in exists at /usr/src/RPM/BUILD/App-perlmv-0.46/blib/lib/App/perlmv.pm line 450.
Use of uninitialized value $anew in exists at /usr/src/RPM/BUILD/App-perlmv-0.46/blib/lib/App/perlmv.pm line 450.
[...]
it is because Cwd::abs_path returns undef if file does not exist, so the loop goes forever.
the patch below helped to bypass the loop, but still a lot of tests failed.
--- lib/App/perlmv.pm 2015-01-04 19:44:56.568798006 +0000
+++ lib/App/perlmv.pm 2015-01-04 19:46:27.980795708 +0000
@@ -416,7 +416,7 @@
my $new = $_;
my $anew = abs_path($new);
#die "Invalid path $new" unless defined($anew);
- $anew = "" if !defined($anew);
+ $anew = $new if !defined($anew);
$self->{_exists}{$aold}++ if (-e $aold);
return if $aold eq $anew;
@@ -447,9 +447,11 @@
unless ($self->{'overwrite'}) {
my $i = 1;
while (1) {
+ #print STDERR "i=$i new=$new anew=$anew\n";
if ((-e $new) || exists $self->{_exists}{$anew}) {
$new = "$orig_new.$i";
$anew = abs_path($new);
+ $anew = $new if !defined($anew);
$i++;
} else {
last;
Subject: | hsh.log |
Message body is not shown because it is too large.