Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jonasbn (1153)

jonasbn
  reversethis-{gro.napc} {ta} {nbsanoj}
http://e-diot.dk/
AOL IM: BJonasN (Add Buddy, Send Message)

Perl Programmer located in Copenhagen, Denmark. Active member of Copenhagen Perl Mongers.

Author of:

  • Business::DK::CPR
  • Business::DK::CVR
  • Business::DK::PO
  • Business::OnlinePayment::CashCow
  • Date::Holidays
  • Date::Holidays::Abstract
  • Date::Holidays::Super
  • Date::Pregnancy
  • Games::Bingo
  • Games::Bingo::Bot
  • Games::Bingo::Print
  • Module::Info::File
  • Module::Template::Setup
  • Test::Timer

and maintainer of:

  • Tie::Tools
  • XML::Conf
  • Workflow

Journal of jonasbn (1153)

Monday February 11, 2008
06:11 PM

3 Packages 1 Uniform $VERSION #Perlmonks++

[ #35635 ]

I have had a problem for quite sometime with some code. We refer to the code as the poor mans configuration management system. (the code snippets below have been shortened to not reflect the name space of the client in question).

All in all it is a CPAN like distribution of files.


Configuration_DEV.pm
Configuration_TEST.pm
Configuration_PROD.pm

The 3 files contain several package definitions, one per application and so forth.

The configurations then vary according to their environments. DEV, TEST and PROD.

So I have subclassed Module::Build and implemented my own install action.

This action reacts to a mandatory commandline argument, so the user has to decide on what environment he/she wants to install.

So if the user specifies test, the installation creates a symlink called Configuration.pm in the install directory pointing to the designated environment specific file.

And everybody is happy.

Or?

My problem is that we constantly add a lot of configurable parameters in these files and new package definitions.

So in order to control this I normally specify what version my new or improved application requires as a minimum in my application's Build.PL.

But the $VERSION has to be defined in all 3 files and even the distributions Build.PL wants it. So I added a VERSION.pm file, which only contained the version.

This works ok, apart from the fact that Module::Build would not recognize and parse the line where I included it in the $VERSION = $VERSION:VERSION;

I have adressed this problem of mine with many fellow Perl mongers, but without any resolution.

I have never been really active on Perlmonks, but yesterday I thought, hey why don't I ask there?

The next day I had two responses to my inquiry

None of these was quite what I was looking for at first, but one of them got me thinking.

So I added yet another action to my Module::Build subclass, so now the version of the distribution is controlled in the Build.PL and the ./Build dist action puts the proper version into all of the environment files in the distribution.

The solution has some minor cosmetic problems, such as the code is changed prior to shipping and does therefor not reflect the code in CVS completely.

But my problem went away and to quote, or I cannot remember the exact quote, but Damian Conway once said that the Perl community was a... lucky/rich something community to have something like Perlmonks.

I can only agree.

Perhaps I should boil my whole poor mans configuration management system down to a writeup on Perlmonks, perhaps somebody else can use it.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.