Bug in port name handling

Kevin Ballard eridius at macports.org
Wed Jan 3 15:08:51 PST 2007


It appears, from looking at the source, that the registry only  
matches the following characters in the version:

   -
   _
   a-z
   A-Z
   0-9
   .

Perhaps this should be modified. I would suggest matching everything  
besides, say, a space here. Everything else should be fine, because  
the routine here (receipt_flat::installed) will always be passed a  
version of the form version_revision[+variants], which means it will  
always end with _digit (followed by optional variants). So whatever  
the version regex matches, it won't accidentally suck up revision and  
variants, because it can't (caveat: if a variant is named foobar_0 it  
could, though I would say a variant should never be named like that,  
but if you want to eliminate this problem then disallow plusses in  
the version string too).

So basically, if you want the ~ character, MacPorts needs  
modification. In the meantime I'd suggest using a dash.

I've CC'ed the dev list - anybody have any thoughts on modifying the  
version-matching regex here? And does anybody know of any other  
locations where the version is matched against a regex?

Final thoughts: I just remembered that this same routine uses glob to  
find the version directory, so versions would also have to restrict  
asterisks, questionmarks, braces, brackets, and backslashes  
(basically, anything that's special to glob). But my stance is the  
more liberal we can make the version matching, the better.

On Jan 3, 2007, at 5:41 PM, Kevin Ballard wrote:

> I'm guessing it doesn't like the ~ character.
>
> [snip]
>
> On Jan 3, 2007, at 2:20 PM, Sbranzo wrote:
>> I thinks there's a bug in the way port names are handled.
>> I'm trying to compile a cvs snapshot of slrn, the same present in  
>> debian
>> experimental. The debian maintainer assigned  
>> 0.9.8.1pl2~cvs20061116 as
>> version number, and I wish to keep this convention.

-- 
Kevin Ballard
http://kevin.sb.org
eridius at macports.org
http://www.tildesoft.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-dev/attachments/20070103/626e0c98/attachment.html


More information about the macports-dev mailing list