Needs review
Project:
Feature Server (fserver)
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Jan 2012 at 13:53 UTC
Updated:
16 Jan 2012 at 15:20 UTC
We've been using the original fserver code from DevelopmentSeed's repo succesfully so far with SVN and CVS-style tag names, but now when we upgraded to 6.x-1.1 CVS-style tagged releases are no longer packaged.
There seems to be a regression in the method fserver_parse_tag_name(): CVS style tag names (projectname-6--1-0-alpha1) now only seem to work for the project 'drupal'. Check this code:
$regex = (stripos($tag, 'drupal-') === 0)
? '/^(?P<project>\w+)-(?P<core>\d+)--(?P<major>\d+)-(?P<patch>\d+)-?(?P<extra>\w+)?$/'
: '/^(?P<core>\d+)\.x-(?P<major>\d+)\.(?P<patch>\d+)-?(?P<extra>\w+)?$/';
The stripos() check only works for projects called 'drupal'. Pretty limited.
My suggestion to fix this: just loop over the array of possible regexes and match them with the tag name, see the attached patch.
| Comment | File | Size | Author |
|---|---|---|---|
| fserver-cvs-style-tags.patch | 2.85 KB | cyberwolf |
Comments
Comment #1
cyberwolf commentedComment #2
eugenmayer commentedThe Tag-names are not "projectname-6--1-0-aplha1" but "6--1-0-aplha1" ...it does even not make sense to add the project name in the tag at all, as this information is highly redundant and just bloating the tags with informations which are trivial and clear and do not need to be part of a tag name.
I have never created tags on d.o. or for the fserver the way you described for contribs and i dont think that is even supported on d.o. - its def. not best practise.
Iam currently not willing wo patch this behavior into the fserver, as it just does not make sense ( and is there for drupal lagacy core project )
Comment #3
cyberwolf commentedDevelopmentSeed's original fserver expected tag names like this.
Please check https://github.com/developmentseed/FeatureServer/blob/master/fserver.module, method fserver_parse_tag_name().
I agree with you that it is a bloated naming scheme, but it existed, so I believe it should be added again to the code base for backwards compatibility's sake and those upgrading from the original fserver code.
Comment #4
cyberwolf commented