port activate error: can't read "revision": no such variable
Hi! I'm writing a portfile for XSB, a logic programming language. When doing a port activate, I get the following error: DEBUG: Executing com.apple.activate (xsb) ---> Activating xsb 3.0.1+_0 Error: Target com.apple.activate returned: can't read "revision": no such variable Warning: the following items did not execute (for xsb): com.apple.activate Error: Status 1 encountered during processing. There is no "revision" variable in the portfile. Any ideas? Thanks, Paulo ----------------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Computer Science, University of Beira Interior 6201-001 Covilhã, Portugal Office 4.3 Ext. 3257 Phone: +351 275319891 Fax: +351 275319899 Email: <mailto:pmoura@di.ubi.pt> Home page: <http://www.di.ubi.pt/~pmoura> Research: <http://logtalk.org/> -----------------------------------------------------------------
On May 9, 2007, at 12:02 PM, Paulo Moura wrote:
There is no "revision" variable in the portfile. Any ideas? Thanks,
This man page seems to contradict itself, but perhaps it's not optional, as mentioned below. MAIN VARIABLES All ports are required to set certain variables. name Full name of port. Type: required Example: name XFree86 version Upstream version of software. Type: required Example: version 4.2.1 epoch If a port's version numbering changes such that a newer version looks older than the previous version, the epoch should be increased. Often the epoch is formatted like a date. Type: optional Default: 0 Example: epoch 20041231 description One line description of the software and what it does. Type: required Example: description Dictionary Server Protocol (RFC2229) client long_description A verbose description of the software and what it does. Type: required Example: long_description The GNU Image Manipulation Program \ (GIMP) is a powerful tool for the preparation and \ manipulation of digital images. The GIMP provides \ the user with a wide variety of image manipulation, \ painting, processing, and rendering tools. revision Local revision number of Portfile. Increment for port revisions which would change its installation in any way. Type: optional Default: 0 -- Paul Beard words: http://paulbeard.org/wordpress pictures: http://www.flickr.com/photos/pdb206/ Are you trying to win an argument or solve a problem?
On 2007/05/09, at 20:29, paul beard wrote:
On May 9, 2007, at 12:02 PM, Paulo Moura wrote:
There is no "revision" variable in the portfile. Any ideas? Thanks,
This man page seems to contradict itself, but perhaps it's not optional, as mentioned below. ... revision Local revision number of Portfile. Increment for port revisions which would change its installation in any way. Type: optional Default: 0
I took a look at some other portfiles. None of them defines the "revision" variable. It also seems that the now I've a corrupted registry: pmmbp:~/Documents/Prolog/xsbcvs pmoura$ sudo port -f install ---> Fetching xsb ---> Verifying checksum(s) for xsb ---> Extracting xsb ---> Configuring xsb ---> Building xsb with target all ---> Staging xsb into destroot ---> Packaging tgz archive for xsb 3.0.1+_0 ---> Installing xsb 3.0.1+_0 Error: Target com.apple.install returned: Registry error: xsb @3.0.1 +_0 already registered as installed. Please uninstall it first. Error: Status 1 encountered during processing. pmmbp:~/Documents/Prolog/xsbcvs pmoura$ sudo port -p uninstall xsb @3.0.1+_0 Error: port uninstall failed: can't read "revision": no such variable pmmbp:~ pmoura$ sudo port -d selfupdate ... pmmbp:~ pmoura$ port outdated Error: port installed failed: Registry error: xsb @0.9.0_0+darwin_8 not registered as installed. No ports are installed. No idea where "xsb @0.9.0_0+darwin_8" as there is no "xsb" port other than the one I'm writing: pmmbp:~ pmoura$ port info xsb No port xsb found. The portfile is pretty simple: PortSystem 1.0 name xsb version 3.0.1+ categories lang maintainers pmoura@logtalk.org description XSB is a Logic Programming and Deductive Database system for Unix and Windows long_description \ XSB is a Logic Programming and Deductive Database system for Unix and Windows. \ It is being developed at the Computer Science Department of the Stony Brook \ University, in collaboration with Katholieke Universiteit Leuven, Universidade \ Nova de Lisboa, Uppsala Universitet and XSB, Inc. homepage http://xsb.sourceforge.net/ master_sites ${homepage} fetch.type cvs cvs.root :pserver:anonymous@xsb.cvs.sourceforge.net:/cvsroot/xsb cvs.module XSB configure.args --prefix=${destroot}/${prefix}/share/${name} worksrcdir "XSB" configure.dir "${worksrcdir}/build" build.dir "${worksrcdir}/build" build.cmd "./makexsb" post-destroot { system "ln -sf ${destroot}${prefix}/share/${name}/${version}/bin/xsb ${destroot}${prefix}/bin/xsb" } Your help is appreciated. And please don't tell me to wipe out my MacPorts installation and start over; I've dozens of ports installed that I use daily. TIA, Paulo ----------------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Computer Science, University of Beira Interior 6201-001 Covilhã, Portugal Office 4.3 Ext. 3257 Phone: +351 275319891 Fax: +351 275319899 Email: <mailto:pmoura@di.ubi.pt> Home page: <http://www.di.ubi.pt/~pmoura> Research: <http://logtalk.org/> -----------------------------------------------------------------
On May 9, 2007, at 4:08 PM, Paulo Moura wrote:
pmmbp:~/Documents/Prolog/xsbcvs pmoura$ sudo port -f install ---> Fetching xsb ---> Verifying checksum(s) for xsb ---> Extracting xsb ---> Configuring xsb ---> Building xsb with target all ---> Staging xsb into destroot ---> Packaging tgz archive for xsb 3.0.1+_0 ---> Installing xsb 3.0.1+_0 Error: Target com.apple.install returned: Registry error: xsb @3.0.1 +_0 already registered as installed. Please uninstall it first. Error: Status 1 encountered during processing. pmmbp:~/Documents/Prolog/xsbcvs pmoura$ sudo port -p uninstall xsb @3.0.1+_0 Error: port uninstall failed: can't read "revision": no such variable
The + in the versions is likely confusing port. You could try escaping it with a \
name xsb version 3.0.1+
change this, either use another character or just remove the + -- Daniel J. Luke +========================================================+ | *---------------- dluke@geeklair.net ----------------* | | *-------------- http://www.geeklair.net -------------* | +========================================================+ | Opinions expressed are mine and do not necessarily | | reflect the opinions of my employer. | +========================================================+
On 2007/05/09, at 21:13, Daniel J. Luke wrote:
The + in the versions is likely confusing port.
If that is really the case, then I would say that I tripped on a MacPorts bug (I'm using the latest version, ).
You could try escaping it with a \
Tried it without success: pmmbp:~/Documents/Prolog/xsbcvs pmoura$ sudo port -p -f uninstall xsb @3.0.1\+_0 Error: port uninstall failed: can't read "revision": no such variable
name xsb version 3.0.1+
change this, either use another character or just remove the +
The version "3.0.1+" comes from the XSB software. I can change it but there should be no need of doing it. Thanks for your suggestions. Paulo ----------------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Computer Science, University of Beira Interior 6201-001 Covilhã, Portugal Office 4.3 Ext. 3257 Phone: +351 275319891 Fax: +351 275319899 Email: <mailto:pmoura@di.ubi.pt> Home page: <http://www.di.ubi.pt/~pmoura> Research: <http://logtalk.org/> -----------------------------------------------------------------
On May 9, 2007, at 1:13 PM, Daniel J. Luke wrote:
On May 9, 2007, at 4:08 PM, Paulo Moura wrote:
pmmbp:~/Documents/Prolog/xsbcvs pmoura$ sudo port -f install ---> Fetching xsb ---> Verifying checksum(s) for xsb ---> Extracting xsb ---> Configuring xsb ---> Building xsb with target all ---> Staging xsb into destroot ---> Packaging tgz archive for xsb 3.0.1+_0 ---> Installing xsb 3.0.1+_0 Error: Target com.apple.install returned: Registry error: xsb @3.0.1+_0 already registered as installed. Please uninstall it first. Error: Status 1 encountered during processing. pmmbp:~/Documents/Prolog/xsbcvs pmoura$ sudo port -p uninstall xsb @3.0.1+_0 Error: port uninstall failed: can't read "revision": no such variable
The + in the versions is likely confusing port.
You could try escaping it with a \
Actually, try doing this: sudo port -p uninstall xsb @3.0.1+_0/ (add a slash to the end of the version number). This disambiguates the version from any variants for the port. I'm not sure it'll work, since I'm still not sure I know where the problem is, but it's worth a try. James
name xsb version 3.0.1+
On 2007/05/09, at 22:57, James Berry wrote:
Actually, try doing this:
sudo port -p uninstall xsb @3.0.1+_0/
(add a slash to the end of the version number). This disambiguates the version from any variants for the port. I'm not sure it'll work, since I'm still not sure I know where the problem is, but it's worth a try.
The problem seems to be that MacPorts is not properly escaping version strings. The "3.0.1+" version comes from the software that the Portfile gets from CVS. This leads me to use the same version name on the portfile, otherwise the symbolic link that is created on the post-destroot phase would be broken. The software builds without trouble but fails on activation with the same dreaded error: ---> Archive for xsb 3.0.1+_0 packaged ---> Installing xsb 3.0.1+_0 DEBUG: Executing com.apple.install (xsb) DEBUG: installing directory: /opt/local/var/db/dports/software/xsb/ 3.0.1+_0/opt DEBUG: installing directory: /opt/local/var/db/dports/software/xsb/ 3.0.1+_0/opt/local DEBUG: installing directory: /opt/local/var/db/dports/software/xsb/ 3.0.1+_0/opt/local/bin DEBUG: installing link: /opt/local/var/db/dports/software/xsb/3.0.1 +_0/opt/local/bin/xsb DEBUG: Executing com.apple.activate (xsb) ---> Activating xsb 3.0.1+_0 Error: Target com.apple.activate returned: can't read "revision": no such variable Warning: the following items did not execute (for xsb): com.apple.activate Error: Status 1 encountered during processing. Thanks for your help, Paulo ----------------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Computer Science, University of Beira Interior 6201-001 Covilhã, Portugal Office 4.3 Ext. 3257 Phone: +351 275319891 Fax: +351 275319899 Email: <mailto:pmoura@di.ubi.pt> Home page: <http://www.di.ubi.pt/~pmoura> Research: <http://logtalk.org/> -----------------------------------------------------------------
Hi, On 10/05/2007, at 08:22, Paulo Moura wrote:
The problem seems to be that MacPorts is not properly escaping version strings. The "3.0.1+" version comes from the software that the Portfile gets from CVS. This leads me to use the same version name on the portfile, otherwise the symbolic link that is created on the post-destroot phase would be broken. The software builds without trouble but fails on activation with the same dreaded error:
<snip />
DEBUG: Executing com.apple.activate (xsb) ---> Activating xsb 3.0.1+_0 Error: Target com.apple.activate returned: can't read "revision": no such variable Warning: the following items did not execute (for xsb): com.apple.activate Error: Status 1 encountered during processing.
You wouldn't happen to be running MacPorts from ToT (a.k.a. trunk), rather than a release version? James Berry has committed some changes recently that removes '+' from the list of acceptable characters in port names (see top of the current ChangeLog [1]). If that's not it, I'm out of ideas :-) Kind regards, Maun Suang [1] http://trac.macports.org/projects/macports/browser/trunk/base/ ChangeLog?rev=24941 -- Boey Maun Suang (Boey is my surname) Email: boeyms@macports.org
On 2007/05/10, at 05:58, Boey Maun Suang wrote:
You wouldn't happen to be running MacPorts from ToT (a.k.a. trunk), rather than a release version?
Nope, I'm running the latest stable one (1.440).
James Berry has committed some changes recently that removes '+' from the list of acceptable characters in port names (see top of the current ChangeLog [1]). If that's not it, I'm out of ideas :-)
That change seems (from an outsider) quite arbitrary. Certainly is possible to escape strings containing characters like "+"? Especially if a name is acceptable as file system name. All the best, Paulo ----------------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Computer Science, University of Beira Interior 6201-001 Covilhã, Portugal Office 4.3 Ext. 3257 Phone: +351 275319891 Fax: +351 275319899 Email: <mailto:pmoura@di.ubi.pt> Home page: <http://www.di.ubi.pt/~pmoura> Research: <http://logtalk.org/> -----------------------------------------------------------------
On May 10, 2007, at 01:28, Paulo Moura wrote:
On 2007/05/10, at 05:58, Boey Maun Suang wrote:
You wouldn't happen to be running MacPorts from ToT (a.k.a. trunk), rather than a release version?
Nope, I'm running the latest stable one (1.440).
James Berry has committed some changes recently that removes '+' from the list of acceptable characters in port names (see top of the current ChangeLog [1]). If that's not it, I'm out of ideas :-)
That change seems (from an outsider) quite arbitrary. Certainly is possible to escape strings containing characters like "+"? Especially if a name is acceptable as file system name.
Maun Suang, that change should affect port names only, not version numbers. I'm not sure if there's any validation on version numbers. Paulo, the change is not arbitrary. The + sign has special meaning in MacPorts: it precedes a selected variant. Perhaps there are parts of MacPorts that become confused when the + sign is used in unexpected places. Therefore, the range of legal portnames is restricted. So too should be the range of legal version numbers. I'm in favor of getting the + out of your version number.
On May 9, 2007, at 14:29, paul beard wrote:
There is no "revision" variable in the portfile. Any ideas? Thanks,
This man page seems to contradict itself, but perhaps it's not optional, as mentioned below. [snip] revision Local revision number of Portfile. Increment for port revisions which would change its installation in any way. Type: optional Default: 0
The revision variable is definitely optional. I've written many (most) portfiles without it.
On 2007/05/10, at 10:02, Ryan Schmidt wrote:
James Berry has committed some changes recently that removes '+' from the list of acceptable characters in port names (see top of the current ChangeLog [1]). If that's not it, I'm out of ideas :-)
That change seems (from an outsider) quite arbitrary. Certainly is possible to escape strings containing characters like "+"? Especially if a name is acceptable as file system name.
Maun Suang, that change should affect port names only, not version numbers. I'm not sure if there's any validation on version numbers.
Paulo, the change is not arbitrary. The + sign has special meaning in MacPorts: it precedes a selected variant. Perhaps there are parts of MacPorts that become confused when the + sign is used in unexpected places. Therefore, the range of legal portnames is restricted. So too should be the range of legal version numbers.
Precedes is the keyword here. The "+" character should only be interpreted as a special character when specifying a variant. Otherwise, it should be treated as a normal, valid character. A command such as: sudo port -p uninstall xsb @3.0.1+_0 should work properly as the variant is specified with the "@" character. Moreover, when doing a "port install" such as: sudo port install xsb +3.0.1+ there is not whitespace preceding the last "+". Therefore, it should not confuse MacPorts. Making "+" an illegal character is just the wrong way of fixing what seems to be a parsing bug in MacPorts. The only illegal characters should be the ones that result in invalid file names (as this would lead to problems when creating archives at the file system level).
I'm in favor of getting the + out of your version number.
The "3.0.1+" version number is not something I control as is used by the third-party software. This software install on a directory named after this version number. Using a different version number in the portfile results in a broken installation. Moreover, what is important here is to fix the MacPorts parsing bug uncovered by my portfile, not finding a workaround for some specific portfile that only a few people care about. All the best, Paulo ----------------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Computer Science, University of Beira Interior 6201-001 Covilhã, Portugal Office 4.3 Ext. 3257 Phone: +351 275319891 Fax: +351 275319899 Email: <mailto:pmoura@di.ubi.pt> Home page: <http://www.di.ubi.pt/~pmoura> Research: <http://logtalk.org/> -----------------------------------------------------------------
On May 10, 2007, at 5:36 AM, Paulo Moura wrote:
there is not whitespace preceding the last "+". Therefore, it should not confuse MacPorts. Making "+" an illegal character is just the wrong way of fixing what seems to be a parsing bug in MacPorts. The only illegal characters should be the ones that result in invalid file names (as this would lead to problems when creating archives at the file system level).
I'm sure we'd be happy to accept a patch which improved the parsing :)
I'm in favor of getting the + out of your version number.
The "3.0.1+" version number is not something I control as is used by the third-party software. This software install on a directory named after this version number. Using a different version number in the portfile results in a broken installation.
Does it just extract to a folder with a + in it? If so, you could specify worksrcdir in your Portfile.
Moreover, what is important here is to fix the MacPorts parsing bug uncovered by my portfile, not finding a workaround for some specific portfile that only a few people care about.
The bug may be just that we didn't specify that + is not allowed in version. -- Daniel J. Luke +========================================================+ | *---------------- dluke@geeklair.net ----------------* | | *-------------- http://www.geeklair.net -------------* | +========================================================+ | Opinions expressed are mine and do not necessarily | | reflect the opinions of my employer. | +========================================================+
On May 10, 2007, at 2:36 AM, Paulo Moura wrote:
I'm in favor of getting the + out of your version number.
The "3.0.1+" version number is not something I control as is used by the third-party software. This software install on a directory named after this version number. Using a different version number in the portfile results in a broken installation. Moreover, what is important here is to fix the MacPorts parsing bug uncovered by my portfile, not finding a workaround for some specific portfile that only a few people care about.
Hi Paulo, When I rewrote major parts of the port(1) command driver a couple of years ago, I did put in accommodation for + in the version (the hack to terminate version with a /). Part of the problem is that the syntax has always allowed run together strings of version+-variants. I believe the problem in this case, however, is not in the port(1) command handler (as it can be forced to distinguish this case as I just said, but in other internal parts of macports that rely on using a combined version+variants string, and which don't automatically use the slash as I just described. As I recall these strings may even get used to build filenames. So yes, I believe that you _will_ run into problems with + in version numbers. I can't tell you exactly where/how/when, but it is a problem/ issue/restriction in the code. If somebody wants to work through this issue and patch the code, they are more than welcome to. Short of that, somebody should come up with a workaround for this particular port so that we can avoid the + in the version number: either by yelling at the port issuer, falling back to a version without the +, or (within macports) using a different version number (perhaps with an additional .1 component on the end instead of the +) to describe this version. The distfile key can then be used to explicitly name the file. Not idea, but I think it can be done. James
On 2007/05/10, at 15:10, Daniel J. Luke wrote:
On May 10, 2007, at 5:36 AM, Paulo Moura wrote:
there is not whitespace preceding the last "+". Therefore, it should not confuse MacPorts. Making "+" an illegal character is just the wrong way of fixing what seems to be a parsing bug in MacPorts. The only illegal characters should be the ones that result in invalid file names (as this would lead to problems when creating archives at the file system level).
I'm sure we'd be happy to accept a patch which improved the parsing :)
I would be happy to provide one but I'm a Logtalk/Prolog programmer, not a Tcl programmer.
I'm in favor of getting the + out of your version number.
The "3.0.1+" version number is not something I control as is used by the third-party software. This software install on a directory named after this version number. Using a different version number in the portfile results in a broken installation.
Does it just extract to a folder with a + in it? If so, you could specify worksrcdir in your Portfile.
The problem is not the folder the software it extracts to but the folder that is created during installation. I could try to patch the original software but that's beside the point.
Moreover, what is important here is to fix the MacPorts parsing bug uncovered by my portfile, not finding a workaround for some specific portfile that only a few people care about.
The bug may be just that we didn't specify that + is not allowed in version.
What should be specified, IMO, is that the version variable should not be set to a string that is invalid as a filename. I agree that this current limitation of MacPorts should be documented in order to avoid porfile writers being trapped in this bug. This is a relatively minor issue and I expect the priority of this bug to be set accordingly. Thanks to all for the feedback on this issue. I will try to convince the original software authors to change the version number to something without a "+". All the best, Paulo ----------------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Computer Science, University of Beira Interior 6201-001 Covilhã, Portugal Office 4.3 Ext. 3257 Phone: +351 275319891 Fax: +351 275319899 Email: <mailto:pmoura@di.ubi.pt> Home page: <http://www.di.ubi.pt/~pmoura> Research: <http://logtalk.org/> -----------------------------------------------------------------
participants (6)
-
Boey Maun Suang
-
Daniel J. Luke
-
James Berry
-
paul beard
-
Paulo Moura
-
Ryan Schmidt