cfengine / design-center

CFEngine community-contributed content
http://cfengine.com/
Other
80 stars 67 forks source link

cf-sketch fails on CentOS 6.5 #431

Open athompso opened 10 years ago

athompso commented 10 years ago

[root@mnt03 ~]# cf-sketch Can't locate DCAPI.pm in @INC (@INC contains: /usr/local/bin/perl-lib /usr/local/bin/perl-lib/File-Path-2.09 /usr/local/bin/perl-lib/File-Which-1.09/lib /usr/local/bin/perl-lib/JSON-2.53/lib /usr/local/bin/perl-lib/Mo-0.31/lib /usr/local/bin/../lib/cf-sketch /usr/local/bin/../lib/cf-sketch/File-Path-2.09 /usr/local/bin/../lib/cf-sketch/File-Which-1.09/lib /usr/local/bin/../lib/cf-sketch/JSON-2.53/lib /usr/local/bin/../lib/cf-sketch/Mo-0.31/lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/bin/cf-sketch line 43. BEGIN failed--compilation aborted at /usr/local/bin/cf-sketch line 43.

Steps to get here:

  1. I cloned the gtithub repo on a machine with internet access
  2. copied the entire repo over to the cfengine hub (scp -r dmzhost:design_center design_center)
  3. On the cfengine hub: cd design_center/tools/cf-sketch
  4. make install
  5. cd ~
  6. cf-sketch
  7. observe this error.

I note that the lib path "/usr/local/bin/../lib/cf-sketch" is present, but the subdirectory "perl-lib" is not.

The simple fix appears to be modify line 39 to read:

("$FindBin::Bin/perl-lib", "$FindBin::Bin/../lib/cf-sketch", "$FindBin::Bin/../lib/cf-sketch/perl-lib");

i.e. add a 3rd element to the map'd LIST that includes the correct path.

athompso commented 10 years ago

I guess I should mention that I'm seeing this behaviour as of commit 369413a59438e845623614686c83e36f04867013. I haven't tested anything older yet.

tzz commented 10 years ago

I've fixed it with 29db619, I think. Could you check?