How to determine the installed version of gettext?
dependencies, gettext, perl, version
Solution
Since "gettext --version" should always return a value on any "contemporary" version (for example, I just tried it on a circa 1997 Redhat ... and it worked!), that should be sufficient.
IMHO...
Problem
I have a Perl module that handles localization tasks using the GNU gettext utilities `xgettext`, `msgfmt`, `msginit`, and `msgmerge`. I got some test failures from a SunOS system which, when I looked into it, seemed to be ancient. For now I am skipping tests when `msgfmt` and `xgettext` choke on a simple `--version` option. But I think it would be better to refuse to install unless a relatively modern version of the GNU Gettext utilities are installed. So, what's the best way to do that? I'd like to just figure out what's installed and if it supports the options I need, and refuse to install the module if those dependencies are not met. Should I just run `gettext --version` and refuse to install if it exits with a non-0 value? Or might there be a more canonical solution?