Re: Bug in port name handling
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@macports.org http://www.tildesoft.com
On Jan 3, 2007, at 6:08 PM, Kevin Ballard wrote:
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.
We had a bunch of problems in the past with more liberal name allowances and ended up being this restrictive to prevent future problems. I'm not sure if the people who worked on this before are still around to comment or not. In any case, any changes to this would need a lot of testing to be sure it doesn't break more than it fixes. -- Daniel J. Luke +========================================================+ | *---------------- dluke@geeklair.net ----------------* | | *-------------- http://www.geeklair.net -------------* | +========================================================+ | Opinions expressed are mine and do not necessarily | | reflect the opinions of my employer. | +========================================================+
participants (2)
-
Daniel J. Luke
-
Kevin Ballard