Report bad component names.

Bug #698806 reported by nobody
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
gEDA
Fix Released
Critical
Unassigned

Bug Description

If a component has a refdes with a dash in it, it will cause problems in PCB. A warning about this in gsch2pcb would be nice.

Revision history for this message
Peter TB Brett (peter-b) wrote :

If someone can provide me with a reliable testcase for this, I'll get it fixed ASAP.

Changed in geda:
importance: Wishlist → Medium
assignee: nobody → Peter TB Brett (peter-b)
status: New → Incomplete
Revision history for this message
Peter TB Brett (peter-b) wrote :

This can be easily reproduced using a footprint name like '0603-pb'.

Changed in geda:
status: Incomplete → Triaged
Revision history for this message
KaiMartin (kmk-familieknaak) wrote :

Please find attached a fairly selfcontained test case.

The file hyphentest.pcb was produced with
      gsch2pcb hyphentest.sch
When opened with pcb, the three resistor footprints that were suppoed to be included are missing. Else, there is no warning. But the pcb file is severely broken. It contains snippets of the m4 library rather than real footprints.

---<)kaimartin(>---

Revision history for this message
Peter TB Brett (peter-b) wrote : Re: gEDA-bug: [Bug 698806] Re: Report bad component names.

Hi KaiMartin,

I've outline a possible solution to this problem in bug 700187.

                          Peter

Revision history for this message
Peter TB Brett (peter-b) wrote :

Please see attached patch, which provides a warning.

[pb00084@ssclt001 hyphentest (master *)]$ gsch2pcb hyphentest.sch
...
WARNING: R3 has footprint name "0805-hyphen" containing a "-" character.
WARNING: R2 has footprint name "0805-hyphen" containing a "-" character.
WARNING: R1 has footprint name "0805-hyphen" containing a "-" character.
...

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

The patch you attached appears to be the wrong file.

Revision history for this message
Peter TB Brett (peter-b) wrote :

Correct patch file this time.

Revision history for this message
Peter TB Brett (peter-b) wrote :

commit eb2a355b688053d917dcb85981062451b27c5e8f
Author: Peter TB Brett <email address hidden>
Date: Mon Jan 24 08:37:46 2011 +0000

    gsch2pcb: Don't pass invalid function names to m4.

    This fixes a long-standing bug with gsch2pcb. gsch2pcb expects
    `footprint' attributes to be of the form:

      footprint=NAME ARG1 ARG2

    This gets transformed to:

      PKG_NAME (`NAME-ARG1-ARG2',`refdes',`value',`ARG1',`ARG2')

    for macro-expansion by M4. For this to work, it requires that NAME
    matches the regular expression ^[A-Za-z0-9_]$ so that PKG_NAME is a
    valid M4 function name.

    It is quite common for users (especially those using John Luciani's
    footprint library) to define and wish to use footprint names which
    contain hyphens '-'. Since this character is not valid in M4 function
    names, this practice causes non-obvious breakage to occur.

    This patch stops gsch2pcb from ever attempting to macro-expand a
    footprint NAME which is obviously not valid as part of an M4 function
    name.

    Closes-bug: lp-698806

Changed in geda:
milestone: none → 1.7.1
status: Triaged → Fix Committed
Revision history for this message
Peter Clifton (pcjc2) wrote :

*************************
*** FANTASTIC NEWS !! ***
*************************

Changed in geda:
importance: Medium → Critical
Peter TB Brett (peter-b)
Changed in geda:
assignee: Peter TB Brett (peter-b) → nobody
Peter TB Brett (peter-b)
Changed in geda:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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