|laziness, impatience, and hubris|
Re: Per-distro versioning and dependency specification (DRY)by tye (Sage)
|on Jun 06, 2012 at 17:31 UTC||Need Help??|
Why is everybody copying version numbers all over the place in their distributions?
First, I agree that it presents problems to have more than one version number associated with a CPAN module distribution (since only one version number per distribution matters when uploading and sorting at CPAN and installing doesn't really support anything beyond "pick one version of the whole dist to install and use").
Second, I have written several module distributions that include more than one package and have never felt the need to expose version numbers except via one package per distribution. And I have never (in any module) done anything with version numbers beyond the default "let the user request 'at least version V'". Version numbers should clearly monotonically increase. So of far more importance to me than most possible aspects of version numbers is the clarity in sorting order. Most attempts to assign "meaning" to parts of version numbers usually just end up causing pain, IME.
So, in the theoretical case of me writing a module that includes multiple packages where there isn't one "main" package that always gets used and so is the only place that needs to support "require at least version V", here is how I would implement that (because it means that there is exactly one place where I track the current version number):
Nothing at all complicated about that. And if you don't want to pull in Exporter, then you have to have two simple lines in each "versioned" package instead of just the one.
Are there any ways in which that trivial solution is not better than any module that does work to copy-and-paste a version string into multiple files or that just checks that you did the copy-and-paste correctly?