Opened 17 years ago

Closed 17 years ago

#11952 closed defect (fixed)

Errors "list must have an even number of elements"

Reported by: vinc17@… Owned by: macports-tickets@…
Priority: High Milestone:
Component: base Version:
Keywords: Cc: vinc17@… kballard (Lily Ballard)
Port:

Description

I often get errors "list must have an even number of elements". For instance:

$ port list
Error: search for portname .+ failed: list must have an even number of elements
$ port list all
Error: /opt/local/bin/port: search for portname * failed: list must have an even number of elements
$ port echo maintainer:vincent-opdarw@vinc17.org
Error: /opt/local/bin/port: search for portname vincent-opdarw@vinc17.org failed: list must have an even number of elements

Change History (5)

comment:1 Changed 17 years ago by kballard (Lily Ballard)

Cc: vinc17@… added; vinc17@… removed

Can you please try running any of those commands with the -d switch? That should give a stack trace.

comment:2 Changed 17 years ago by vinc17@…

$ port -d list
[...]
DEBUG: Found port in file:///Users/vinc17/software/dports/multimedia/emotion
DEBUG: Found port in file:///Users/vinc17/software/dports/multimedia/emotion
DEBUG: list must have an even number of elements
    while executing
"array set portinfo $line"
    (procedure "dportsearch" line 39)
    invoked from within
"dportsearch ^$search_string\$ no"
Error: search for portname .+ failed: list must have an even number of elements

$ port -d list all
[...]
DEBUG: Found port in file:///Users/vinc17/software/dports/multimedia/emotion
DEBUG: Found port in file:///Users/vinc17/software/dports/multimedia/emotion
DEBUG: list must have an even number of elements
    while executing
"array set portinfo $line"
    (procedure "dportsearch" line 39)
    invoked from within
"dportsearch $pattern $casesensitive $matchstyle $field"
Error: /opt/local/bin/port: search for portname * failed: list must have an even number of elements

$ port -d echo maintainer:vincent-opdarw@vinc17.org
[...]
DEBUG: Found port in file:///Users/vinc17/software/dports/math/pari
DEBUG: list must have an even number of elements
    while executing
"array set portinfo $line"
    (procedure "dportsearch" line 25)
    invoked from within
"dportsearch $pattern $casesensitive $matchstyle $field"
Error: /opt/local/bin/port: search for portname vincent-opdarw@vinc17.org failed: list must have an even number of elements

comment:3 Changed 17 years ago by kballard (Lily Ballard)

Sounds like you have a damaged PortIndex file. If you have an svn checkout of the dports tree, do an svn update and make sure your PortIndex file isn't modified. Otherwise do a sudo port sync.

comment:4 Changed 17 years ago by vinc17@…

That was the problem (I sometimes run portindex manually, and after a svn update, it gets corrupted... it seems that I forgot to revert it or rerun it). Shouldn't the port command detect corrupted PortIndex files and provide a meaningful error message?

comment:5 Changed 17 years ago by kballard (Lily Ballard)

Resolution: fixed
Status: newclosed

Ok, r26040 adds a warning when it thinks your PortIndex file is corrupt.

Note: See TracTickets for help on using tickets.