Tuesday, June 12, 2007

Linux / OSX Dependency Checking Script

Hello all. Today, I spent the better part of 10 hours writing a BASH script that aims to identify dependency issues for OpenMRS. The script seems to work on most any Linux distro as well as OSX. But please, test it out, and let me know what you find. If something doesn't work, chances are parts of your system are out of date. Before running the script, please ensure that you have an updated version of BASH. I'm running version 3.2.17(1)-release.

$ bash --version
GNU bash, version 3.2.17(1)-release

The script depends on AWK as well, but the version shouldn't matter and most systems have this by default anyways. The script will notify you if you are missing needed dependencies, or if the versions you have are out of date. If you receive syntax errors, that's what I need to know about. Also, if you are absolutely positive that the script is providing wrong information (i.e you have the latest version of XXX app, and it says you either don't have it, or it's too old) tell me that as well.

You can download the script here: http://discosoup.net:8080/~agent/depend-check.sh
(Make sure you open that in a new tab)

Just do a chmod +x depend-check.sh and then:

bash ./depend-check.sh


and you should be set.

Thanks goes out to Matthew Harrison "[omegentoox]" for helping me test the code out on a few different platforms, as well as for the hosting of the script.

1 comment:

Andreas Kollegger said...

Just tried it on my known-good MacOSX install and got all thumbs up for dependencies. Looks good.

For bonus points, you can check for port (for BSD), apt-get (for Debian derivatives) or rpm (for those Redhat derivatives) then offer to download the needed packages.