config string "always-promote-attributes" not space-safe

Bug #698528 reported by Peter Clifton
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gEDA
In Progress
Low
Werner Hoch

Bug Description

The list of attributes to always promote is quoted as a string with spaces between attributes. This assumes spaces aren't legal characters in an attribute name, which is not formally defined anywhere. (Only that spaces aren't allowed immediately before the "=" of the attribute text).

Revision history for this message
werner2101 (werner2101) wrote :

Can we just change the attribute definition?
I don't think it's a good idea to have whitespace characters in the attribute names.

Possible fix is to add the attributes to the always-promote-attributes one by one.
see also: attribute-name definitions in gschem/lib/system-gschemrc.

regards
Werner

Revision history for this message
werner2101 (werner2101) wrote :

Thought again about that problem.
If the elements are added one by one, the default list in system-gschemrc can be extended but no elements can be removed.

The currently used space separated list of attributes might be the better choice.

Regards
Werner

Revision history for this message
Peter Clifton (pcjc2) wrote :

I thought the solution might be to have the setter take a scheme list of strings.

OTOH, this is probably one of the gafrc settings which people may actually use, so we ought not to remove the old API. Seems I'm the first / only one to spot the problem, so it might not warrant a new API just yet.

Revision history for this message
werner2101 (werner2101) wrote :

Wrote possible fix for the issue:
http://repo.or.cz/w/geda-gaf/werner.git?a=shortlog;h=refs/heads/bugfix_promote_attributes

* Accept the old syntax and add a new one to accept a scm list of strings.
* Print a deprecation warning for the old syntax.
* Convert both syntax variants internally into a GList.

Regards
Werner

Revision history for this message
Peter Clifton (pcjc2) wrote :

I like that proposed fix, it keeps various parts of the code cleaner.

Revision history for this message
nobody (nobody-users) wrote :

I like this fix as well. I'm also not opposed to change the attribute def to not allow spaces in the name anywhere. -Ales

Revision history for this message
nobody (nobody-users) wrote :

pushed the fix to the git repo:

commit 4043c6326d7d56e01cd878a81d1e86c0fcb774b8
Author: Werner Hoch <email address hidden>
Date: Fri Oct 10 10:33:02 2008 +0200

I'm leaving the tracker open till we fixed the attribute definition as well.

Peter TB Brett (peter-b)
Changed in geda:
status: New → In Progress
assignee: nobody → Werner Hoch (werner-ho)
Revision history for this message
Vladimir Zhbanov (vzhbanov) wrote :

Would the following definition in the Master Attribute List be sufficient?

  Attribute name must not contain any whitespaces in it.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.