[MacPorts] #28084: Registry error for ports with underscore ('_') in version
#28084: Registry error for ports with underscore ('_') in version ---------------------------------+------------------------------------------ Reporter: ken@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.2 Keywords: registry version | Port: ---------------------------------+------------------------------------------ If a port has an underscore ('_') in its version, then any attempt to install it will result in a registry error: {{{ Error: Target org.macports.activate returned: Registry error: No port of <port> installed. }}} Examples include aspell-dict-it, whose version is 2.2_20050523-0, and aspell-dict-pl, whose version is 6.0_20061121-0. I have worked around this problem by editing the Portfile to a) manually substitute the original value of version into the distname, and b) changing the underscore in the version to a dash ('-'). I suspect that something in the registry lookup is scanning for the "_${revision}" that's appended to the port version, but it is scanning forward for the underscore starting at the beginning of the string instead of scanning backward from the end. -- Ticket URL: <https://trac.macports.org/ticket/28084> MacPorts <http://www.macports.org/> Ports system for Mac OS
#28084: Registry error for ports with underscore ('_') in version ---------------------------------+------------------------------------------ Reporter: ken@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: registry version | Port: ---------------------------------+------------------------------------------ Changes (by ryandesign@…): * component: ports => base -- Ticket URL: <https://trac.macports.org/ticket/28084#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#28084: Registry error for ports with underscore ('_') in version ---------------------------------+------------------------------------------ Reporter: ken@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: registry version | Port: ---------------------------------+------------------------------------------ Comment(by ryandesign@…): Are you using the flat registry or the sql registry? (See portdbformat in macports.conf) -- Ticket URL: <https://trac.macports.org/ticket/28084#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#28084: Registry error for ports with underscore ('_') in version ---------------------------------+------------------------------------------ Reporter: ken@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: registry version | Port: ---------------------------------+------------------------------------------ Comment(by ken@…): Replying to [comment:2 ryandesign@…]:
Are you using the flat registry or the sql registry? (See portdbformat in macports.conf)
The SQL registry. -- Ticket URL: <https://trac.macports.org/ticket/28084#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#28084: Registry error for ports with underscore ('_') in version ---------------------------------+------------------------------------------ Reporter: ken@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: registry version | Port: ---------------------------------+------------------------------------------ Comment(by jmr@…): Works for me (I maintain iozone, for example). This sounds a lot like #23966. Are you sure you're using the 1.9.2 release and not some old pre-1.9 trunk version? -- Ticket URL: <https://trac.macports.org/ticket/28084#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#28084: Registry error for ports with underscore ('_') in version ---------------------------------+------------------------------------------ Reporter: ken@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: registry version | Port: ---------------------------------+------------------------------------------ Comment(by ken@…): Replying to [comment:4 jmr@…]:
Works for me (I maintain iozone, for example). This sounds a lot like #23966. Are you sure you're using the 1.9.2 release and not some old pre-1.9 trunk version? I did a "sudo port selfupdate" immediately before encountering this issue. This is from just now:
{{{ $ port version Version: 1.9.2 }}} Would it help if I revert my edit to the Portfiles and collect a log? -- Ticket URL: <https://trac.macports.org/ticket/28084#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#28084: Registry error for ports with underscore ('_') in version ---------------------------------+------------------------------------------ Reporter: ken@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: registry version | Port: ---------------------------------+------------------------------------------ Comment(by jmr@…): Actually I do see this for the ports you mention, but not for all ports with an underscore in the version. -- Ticket URL: <https://trac.macports.org/ticket/28084#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#28084: Registry error for ports with underscore ('_') in version ---------------------------------+------------------------------------------ Reporter: ken@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: registry version | Port: ---------------------------------+------------------------------------------ Comment(by jmr@…): Using a full version spec when activating or deactivating works, so something is not figuring out the version from the registry correctly when no version is given. -- Ticket URL: <https://trac.macports.org/ticket/28084#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#28084: Registry error for ports with underscore ('_') in version ---------------------------------+------------------------------------------ Reporter: ken@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: registry version | Port: ---------------------------------+------------------------------------------ Comment(by ken@…): Replying to [comment:6 jmr@…]:
Actually I do see this for the ports you mention, but not for all ports with an underscore in the version. I believe I have identified the issue. It's the underscore '''and the dash''' in "2.2_20050523-0". iozone's version is 3_373, which has no dash.
Now, look at proc decode_spec (/opt/local/share/macports/Tcl/registry2.0/registry_util.tcl:55): {{{ proc decode_spec {specifier version revision variants} { upvar 1 $version ver $revision rev $variants var return [regexp {^([^+]+?)(_(\d+)(([-+][^-+]+)*))?$} $specifier - ver - rev v ar] } }}} Experimenting interactively with that regexp: {{{ $ tclsh % echo [regexp {^([^+]+?)(_(\d+)(([-+][^-+]+)*))?$} "2.2_20050523-0_0" - ver - rev var] 1 % echo $ver 2.2 % echo $rev 20050523 % echo $var -0_0 % echo [regexp {^([^+]+?)(_(\d+)(([-+][^-+]+)*))?$} "3_373_0" - ver - rev var] 1 % echo $ver 3_373 % echo $rev 0 % echo $var % }}} -- Ticket URL: <https://trac.macports.org/ticket/28084#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#28084: Registry error for ports with underscore ('_') in version ---------------------------------+------------------------------------------ Reporter: ken@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: registry version | Port: ---------------------------------+------------------------------------------ Comment(by jmr@…): simul-posted with the above :-) So, [source:trunk/base/src/registry2.0/registry_util.tcl#L53 this] is interpreting the version spec `2.2_20050523-0_0` obtained from the registry as version 2.2, revision 20050523, and variants -0_0. I believe this is a genuine ambiguity in the syntax. We can probably make it better by requiring variant names to have at least one letter, but the possibility of misinterpretation remains for ports with letter in their version. -- Ticket URL: <https://trac.macports.org/ticket/28084#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
#28084: Use of composite version specs should be avoided ---------------------------------+------------------------------------------ Reporter: ken@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: registry version | Port: ---------------------------------+------------------------------------------ Comment(by jmr@…): So basically we want to be passing around separate version,revision,variants values whenever possible. The use of composite versions is a holdover from the flat registry, which ironically avoided this problem by actually storing the values this way. (So it would only run into trouble if there actually were two versions of a port installed at the same time where a different possible interpretation was correct for each.) -- Ticket URL: <https://trac.macports.org/ticket/28084#comment:10> MacPorts <http://www.macports.org/> Ports system for Mac OS
#28084: Use of composite version specs should be avoided ---------------------------------+------------------------------------------ Reporter: ken@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: registry version | Port: ---------------------------------+------------------------------------------ Comment(by jmr@…): Added at-least-one-letter requirement to variant name parsing in r75336. -- Ticket URL: <https://trac.macports.org/ticket/28084#comment:11> MacPorts <http://www.macports.org/> Ports system for Mac OS
#28084: Use of composite version specs should be avoided ----------------------------------+----------------------------------------- Reporter: ken@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: MacPorts 2.0.0 Component: base | Version: 1.9.2 Resolution: fixed | Keywords: registry version Port: | ----------------------------------+----------------------------------------- Changes (by jmr@…): * status: new => closed * resolution: => fixed * milestone: => MacPorts 2.0.0 Comment: This should be taken care of on the registry side by r79167. The front end could potentially need some more work, since it accepts composite version specs as user input, but we'll see how this goes. -- Ticket URL: <https://trac.macports.org/ticket/28084#comment:12> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts