Bug 661946

Summary: [RFE] Hard coded paths to share files
Product: [Community] Publican Reporter: Jeff Fearn <jfearn>
Component: publicanAssignee: Jeff Fearn <jfearn>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 2.5CC: mmcallis, pkovar, publican-list, raphael, rglasz, xma
Target Milestone: 3.1   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 3.1.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-05 22:40:39 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 874180    

Description Jeff Fearn 2010-12-09 22:14:13 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):
2.5

Additional info:
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.
Comment 1 Jeff Fearn 2012-11-06 23:47:09 EST
Proposed solution:

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


e.g.

In Build.PL

$builder->config_data('cfg_path', $builder->install_path('etc'));

Then in code:

use Publican::ConfigData;
my $cfg_path = Publican::ConfigData->config('cfg_path');

open($FOO, "<", "$cfg_path/publican-website.cfg");
Comment 2 Jeff Fearn 2012-11-27 07:00:02 EST
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.
Comment 3 Raphaƫl Hertzog 2012-12-03 04:01:39 EST
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.
Comment 4 Jeff Fearn 2012-12-03 17:25:18 EST
(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
Comment 5 Jeff Fearn 2013-01-06 23:25:35 EST
This fix has been committed to the devel branch for inclusion in Publican 3.1.
Comment 6 xuezhi ma 2013-01-31 03:20:17 EST
Hi Jeff, 

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