cvs [diff aborted]: no such directory `modules/update_status' Index: modules/update_status/update_status.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/update_status/update_status.module,v retrieving revision 1.34 diff -u -p -r1.34 update_status.module --- modules/update_status/update_status.module 22 May 2007 23:28:43 -0000 1.34 +++ modules/update_status/update_status.module 23 May 2007 19:38:51 -0000 @@ -244,12 +244,25 @@ function update_status_make_nice_version if (!$version) { $version = 'HEAD'; } + else { + // We can assume at least 5.x, which simplifies things. Also, + // core doesn't use the $Name at all, so we can assume contrib. + $match = array(); + // First, see if it's a full, official release from a tag: + if (preg_match('@^DRUPAL-(\d+)--(\d+)-(\d+)(-.+)?@', $version, $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 a branch (development snapshot). + else if (preg_match('@^DRUPAL-(\d+)(--(\d+))?@', $version, $match)) { + $version = $match[1] .'.x-'. (isset($match[3]) ? $match[3] : '1') .'.x-dev'; + } + } } - - // TODO: sanitize this further but I can't figure out where dww's code to - // do that lives. $type = 'cvs'; - return $version; }