Improve Portability of Git Version Check for z/OS

What does this MR do?

Replaces the --version-sort, which is unsupported on z/OS, with standard sort usage. The new command used is shown:

sort -t '.' -k 1,1n -k 2,2n -k 3,3n -k 4,4n

-t specifies the separator, .. In -k 1,1n, n specifies a numeric comparison of the 1st field also bounded to the 1st field. As such, this command would support version comparison on up to four version fields (IE: 1.2.3.4).

Why was this MR needed?

z/OS does not support the --version-sort flag.

What's the best way to test this MR?

The existing pipeline test cases surfaced the command failure on z/OS.

What are the relevant issue numbers?

Merge request reports

Loading