there's a little bit of similar functionality in cvs.module. however, we can make 2 simplifying assumptions here (5.x and beyond, and only contrib), and we need a much simpler output (the human readable string) than cvs.module does (a whole array of parts of the version string). so, i just re-implemented this via 2 preg_match() calls.

note that this seems to confuse our CVS vs. dev-snapshot detection code, but i think a better solution to that is at http://drupal.org/node/146027. therefore, i'd be happy to just commit this first, then clean up the CVS detection via that issue.

Comments

merlinofchaos’s picture

The patch looks good; I think $match = array() can be moved up, however, and the whole construct reduced to if / else if / else if / else rather than the nesting. Once you've got that, it's RTBC, I think.

dww’s picture

Status: Needs review » Needs work

ahh, yeah, i see what you mean. sure, i'll re-roll.

dww’s picture

Status: Needs work » Needs review
StatusFileSize
new2.36 KB
dww’s picture

Status: Needs review » Fixed

merlinofchaos RTBC'ed in IRC, committed to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)