Logo Search packages:      
Sourcecode: aegir-provision version File versions  Download package

_provision_cvs_deploy_version_from_tag ( tag  ) 

Returns the human-readable version string from a given CVS tag.

Definition at line 84 of file cvs_deploy.inc.

Referenced by _provision_cvs_deploy_version_alter().

                                                      {
  // If there's nothing, it must be a HEAD checkout, and therefore,
  // we have no idea what the version is.
  if (!$tag || $tag == 'HEAD') {
    $version = 'HEAD';
  }
  // See if it's a Drupal core release
  elseif (preg_match('@^DRUPAL-(\d+)-(\d+)$@', $tag, $match)) {
    $version = $match[1] . '.' . $match[2];
  }
  // See if it's a full, official release from a tag:
  elseif (preg_match('@^DRUPAL-(\d+)--(\d+)-(\d+)(-.+)?@', $tag, $match)) {
    $version = $match[1] .'.x-'. $match[2] .'.'. $match[3];
    if (isset($match[4])) {
      // This version's tag has 'extra', so clean that up.
      $version .= '-'. preg_replace('/[_-]/', '', strtolower($match[4]));
    }
  }
  // If not, see if it's from a branch (like a development snapshot).
  elseif (preg_match('@^DRUPAL-(\d+)(--(\d+))?@', $tag, $match)) {
    $version = $match[1] .'.x-'. (isset($match[3]) ? $match[3] : '1') .'.x-dev';
  }
  return $version;
}


Generated by  Doxygen 1.6.0   Back to index