ceph: tools: parse Ceph version in separate sub and update regex
The part of the `get_local_version` sub that's concerned with actually
parsing the Ceph version is factored into a separate sub
`parse_ceph_version`. That way the parsing logic can easily be reused.
Make the version regex more maintainable declaring it as a variable,
breaking it up and commenting it by using the x flag.
Also remove the part that parses our Debian revision (e.g. -pve1) from
the version, as we do not actually include that in our Ceph builds.
The part of the regex that parses the build commit hash is made
mandatory (remove '?' after its group).
Signed-off-by: Max Carrara <m.carrara@proxmox.com> Tested-by: Lukas Wagner <l.wagner@proxmox.com> Reviewed-by: Lukas Wagner <l.wagner@proxmox.com> Tested-by: Igor Thaller <igor.thaller@brg9.at>