install <install_path> doesn't work on HEAD
От
Amit Kapila
Тема
install <install_path> doesn't work on HEAD
Дата
Msg-id
CAA4eK1+XuFzkPC21zzrKEdDraXUynB9C4hxAdMgiPsKFuucV4A@mail.gmail.com
Список
Дерево обсуждения
install <install_path> doesn't work on HEAD Amit Kapila <amit.kapila16@gmail.com>
Re: install <install_path> doesn't work on HEAD Ashutosh Sharma <ashu.coek88@gmail.com>
Re: install <install_path> doesn't work on HEAD Amit Kapila <amit.kapila16@gmail.com>
Hi,
@@ -40,7 +40,7 @@ sub lcopy
copy($src, $target)
|| confess "Could not copy $src to $target\n";
- return;
+ return 1;
}
On my win-7, I am facing $SUBJECT. I am consistently getting below error:
Copying build output files...Could not copy postgres.exe
at install.pl line 26.
On digging, I found that it started failing with commit 3a7cc727 (Don't fall off the end of perl functions). It seems that we have added empty 'return' in all of the functions which seems to break one of the case:
lcopy("$conf\\$pf\\$pf.$ext", "$target\\$dir\\$pf.$ext")
|| croak "Could not copy $pf.$ext\n";
|| croak "Could not copy $pf.$ext\n";
I think the return from lcopy implies 0 (or undef) which cause it to fail. By reading couple of articles on net [1][2] related to this, it seems we can't blindly return in all cases. On changing, the lcopy as below, install appears to be working.
@@ -40,7 +40,7 @@ sub lcopy
copy($src, $target)
|| confess "Could not copy $src to $target\n";
- return;
+ return 1;
}
I have randomly check some of the other functions where this patch has added 'return' and those seem to be fine.
Is it by any chance related Perl version or some other settings? If not, then we should do something for it.
[2] - http://search.cpan.org/dist/Perl-Critic/lib/Perl/Critic/Policy/Subroutines/RequireFinalReturn.pm
--
В списке pgsql-hackers по дате отправления