Ian Wienand 2ba36cda79 Add vercmp function
The existing vercmp_numbers function only handles, as the name says,
numbers.  I noticed that "sort" has had a version sort for a long time
[1] and, rather than re-implement it badly, use this as a version of
vercmp that works a bit more naturally.

This is intended to be used in an "if" statement as in

  prog_ver=$(prog_ver --version | grep ...)
  if vercmp $prog_ver "<" 2.0; then
     ...
  fi

A test-case is added to test the basic features and some edge-cases.

[1] http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=4c9fae4e97d95a9f89d1399a8aeb03051f0fec96

Change-Id: Ie55283acdc40a095b80b2631a55310072883ad0d
2015-11-19 09:37:33 +11:00
..
2014-09-09 13:54:01 +01:00
2015-07-23 06:46:24 +10:00
2015-11-19 09:37:33 +11:00
2015-07-01 06:29:27 +10:00
2015-11-19 09:37:33 +11:00