Red Hat Bugzilla – Bug 661946
[RFE] Hard coded paths to share files
Last modified: 2013-02-05 22:40:39 EST
Description of problem:
Currently Publican has hard coded paths for share content, /usr/share/publican on Linux, these path should be sourced from the local perl install.
Version-Release number of selected component (if applicable):
Hard coded path makes porting to other platforms harder.
http://search.cpan.org/~jkutej/Module-Build-SysPath-0.13/ should allow this behaviour.
http://search.cpan.org/~jkutej/Sys-Path-0.10/ has an example of using the above.
Add calls to config_data in Build.PL to create a Publican::ConfigData at build time. See http://search.cpan.org/~leont/Module-Build-0.4003/lib/Module/Build/Authoring.pod#SAVING_CONFIGURATION_INFORMATION
Then in code:
my $cfg_path = Publican::ConfigData->config('cfg_path');
open($FOO, "<", "$cfg_path/publican-website.cfg");
I've committed a first shot at fixing this to a new branch.
git checkout bz661946
Seems to work well and should be fairly portable.
Updated README with an example of how to override the paths on the command line during building.
Did you expect me to review or have a try ? I'm fairly busy right now so I was not planning to do it... but if you believe that it's needed, I will try to find a slot for this.
(In reply to comment #3)
> Did you expect me to review or have a try ? I'm fairly busy right now so I
> was not planning to do it... but if you believe that it's needed, I will try
> to find a slot for this.
The comment was mostly for me to remember what I'd done :) But if you have an itch to scratch then that's just free beer :D
This fix has been committed to the devel branch for inclusion in Publican 3.1.
I remember that QE won't test this bug, and we have add this bug in "Features not to be tested" in test plan, so please help to verify this bug and change the bug status, thanks very much