Bug 661946 - [RFE] Hard coded paths to share files
Summary: [RFE] Hard coded paths to share files
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 2.5
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: 3.1
Assignee: Jeff Fearn 🐞
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks: 874180
TreeView+ depends on / blocked
 
Reported: 2010-12-10 03:14 UTC by Jeff Fearn 🐞
Modified: 2013-02-06 03:40 UTC (History)
6 users (show)

Fixed In Version: 3.1.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-06 03:40:39 UTC
Embargoed:


Attachments (Terms of Use)

Description Jeff Fearn 🐞 2010-12-10 03:14:13 UTC
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-07 04:47:09 UTC
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 12:00:02 UTC
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 09:01:39 UTC
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 22:25:18 UTC
(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-07 04:25:35 UTC
This fix has been committed to the devel branch for inclusion in Publican 3.1.

Comment 6 xuezhi ma 2013-01-31 08:20:17 UTC
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


Note You need to log in before you can comment on or make changes to this bug.