Module Pkg::Util::Version
In: lib/packaging/util/version.rb

Utility methods used for versioning projects for various kinds of packaging

Methods

Constants

GIT = Pkg::Util::Tool::GIT

External Aliases

is_git_repo? -> is_git_repo

Public Class methods

Utility method to return the dist method if this is a redhat box. We use this in rpm packaging to define a dist macro, and we use it in the pl:fetch task to disable ssl checking for redhat 5 because it has a certs bundle so old by default that it‘s useless for our purposes.

Return information about the current tree, using `git describe`, ready for further processing.

Returns an array of one to four elements, being:

  • version (three dot-joined numbers, leading `v` stripped)
  • the string ‘rcX’ (if the last tag was an rc release, where X is the rc number)
  • commits (string containing integer, number of commits since that version was tagged)
  • dirty (string ‘dirty’ if local changes exist in the repo)

Return the ref type of HEAD on the current branch

return the sha of HEAD on the current branch

If HEAD is a tag, return the tag. Otherwise return the sha of HEAD.

Determines if this package is a final package via the selected version_strategy. There are currently two supported version strategies.

This method calls down to the version strategy indicated, defaulting to the rc_final strategy. The methods themselves will return false if it is a final release, so their return values are collected and then inverted before being returned.

Return true if we‘re in a git repo, otherwise false

the odd_even strategy (mcollective) final: ‘0.8.0’ ‘1.8.0-63’ ‘0.8.1-63-dirty’ development: ‘0.7.0’ ‘1.7.0-63’ ‘0.7.1-63-dirty‘

the rc_final strategy (default) Assumes version strings in the formats: final: ‘0.7.0’ ‘0.7.0-63’ ‘0.7.0-63-dirty’ development: ‘0.7.0rc1 (we don‘t actually use this format anymore, but once did) ‘0.7.0-rc1’ ‘0.7.0-rc1-63’ ‘0.7.0-rc1-63-dirty‘

This is a stub to ease testing…

[Validate]