[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[creduce-bugs] Path comparison without realpath



Hi creduce-bugs,

I tried to use creduce on a new machine and I got a problem about some prereqs not found. After investigation, I found out that the check_prereqs functions of pass_clang and pass_clex were comparing $FindBin::Bin with bindir to find out whether the executable is in the installation directory or the source directory. The problem is that in my current configuration, bindir (which I gave at installation time) goes through a symbolic link and $FindBin::Bin is a canonical path. As a consequence, creduce thinks the executable is in the source directory and cannot find some other executables.

Using Cwd::realpath(bindir) instead of bindir in the comparisons works for me (a patch is attached). I suspect that storing bindir correctly in creduce_config.pm from start should also work, but I don't know perl and configure enough to test it.

Anyway, thanks for this great tool!
Julien
diff --git a/tis-creduce-installer/creduce-2.1.0/creduce/pass_clang.pm b/tis-creduce-installer/creduce-2.1.0/creduce/pass_clang.pm
index 9b19c72..d1d8cb8 100644
--- a/tis-creduce-installer/creduce-2.1.0/creduce/pass_clang.pm
+++ b/tis-creduce-installer/creduce-2.1.0/creduce/pass_clang.pm
@@ -30,7 +30,7 @@ my $ORIG_DIR;
 sub check_prereqs () {
     $ORIG_DIR = getcwd();
     my $path;
-    if ($FindBin::Bin eq bindir) {
+    if ($FindBin::Bin eq Cwd::realpath(bindir)) {
 	# This script is in the installation directory.
 	# Use the installed `clang_delta'.
 	$path = libexecdir . "/clang_delta";
diff --git a/tis-creduce-installer/creduce-2.1.0/creduce/pass_clex.pm b/tis-creduce-installer/creduce-2.1.0/creduce/pass_clex.pm
index 3183e25..f24aa2a 100644
--- a/tis-creduce-installer/creduce-2.1.0/creduce/pass_clex.pm
+++ b/tis-creduce-installer/creduce-2.1.0/creduce/pass_clex.pm
@@ -30,7 +30,7 @@ my $ORIG_DIR;
 sub check_prereqs () {
     $ORIG_DIR = getcwd();
     my $path;
-    if ($FindBin::Bin eq bindir) {
+    if ($FindBin::Bin eq Cwd::realpath(bindir)) {
 	# This script is in the installation directory.
 	# Use the installed `clex'.
 	$path = libexecdir . "/clex";