[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (149be27757ce66a2384c35c93bc41fe3b256b11d)



The branch, master has been updated
       via  149be27757ce66a2384c35c93bc41fe3b256b11d (commit)
       via  f040d22940c0d4de724923e3b2aadb4afe9f6239 (commit)
      from  97c150e44a768b873946b62b36bad430c9a1b8a0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/action.c          |    4 ++--
 tools/gnet-pcbfwd.scm |   22 ++++++++++++++++------
 2 files changed, 18 insertions(+), 8 deletions(-)


=================
 Commit Messages
=================

commit 149be27757ce66a2384c35c93bc41fe3b256b11d
Author: kai-martin <kmk@xxxxxxxxxxxxxxxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    modified: action.c (fix element name position on import schematic)

:100644 100644 5f1c7a1... 12745d1... M	src/action.c

commit f040d22940c0d4de724923e3b2aadb4afe9f6239
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Quote strings
    
    Quote all strings that might contains commas or close parens,
    to avoid syntax errors when those names are passed to actions.

:100644 100644 360859f... 29274a6... M	tools/gnet-pcbfwd.scm

=========
 Changes
=========

commit 149be27757ce66a2384c35c93bc41fe3b256b11d
Author: kai-martin <kmk@xxxxxxxxxxxxxxxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    modified: action.c (fix element name position on import schematic)

diff --git a/src/action.c b/src/action.c
index 5f1c7a1..12745d1 100644
--- a/src/action.c
+++ b/src/action.c
@@ -7112,8 +7112,8 @@ ActionElementList (int argc, char **argv, int x, int y)
 
       for (i=0; i<MAX_ELEMENTNAMES; i++)
 	{
-	  pe->Name[i].X = e->Name[i].X - mx;
-	  pe->Name[i].Y = e->Name[i].Y - my;
+	  pe->Name[i].X = e->Name[i].X - mx + pe->MarkX ;
+	  pe->Name[i].Y = e->Name[i].Y - my + pe->MarkY ;
 	  pe->Name[i].Direction = e->Name[i].Direction;
 	  pe->Name[i].Scale = e->Name[i].Scale;
 	}

commit f040d22940c0d4de724923e3b2aadb4afe9f6239
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Quote strings
    
    Quote all strings that might contains commas or close parens,
    to avoid syntax errors when those names are passed to actions.

diff --git a/tools/gnet-pcbfwd.scm b/tools/gnet-pcbfwd.scm
index 360859f..29274a6 100644
--- a/tools/gnet-pcbfwd.scm
+++ b/tools/gnet-pcbfwd.scm
@@ -19,6 +19,7 @@
 
 ;; PCB forward annotation script
 
+(use-modules (ice-9 regex))
 (use-modules (ice-9 format))
 
 ;; This is a list of attributes which are propogated to the pcb
@@ -32,6 +33,12 @@
     "vendor_part_number"
     ))
 
+(define (pcbfwd:quote-string s)
+  (string-append "\""
+		 (regexp-substitute/global #f "\"" s 'pre "\\\"" 'post)
+		 "\"")
+  )
+
 (define (pcbfwd:pinfmt pin)
   (format #f "~a-~a" (car pin) (car (cdr pin)))
   )
@@ -52,9 +59,9 @@
   (if (not (null? attrs))
       (let ((attr (car attrs)))
 	(format port "ElementSetAttr(~a,~a,~a)~%"
-		refdes
-		attr
-		(gnetlist:get-package-attribute refdes attr))
+		(pcbfwd:quote-string refdes)
+		(pcbfwd:quote-string attr)
+		(pcbfwd:quote-string (gnetlist:get-package-attribute refdes attr)))
 	(pcbfwd:each-attr refdes (cdr attrs) port))))
 
 ;; write out the pins for a particular component
@@ -68,7 +75,7 @@
 		(pinnum #f)
 		)
 	    (display "ChangePinName(" port)
-	    (display package port)
+	    (display (pcbfwd:quote-string package) port)
 	    (display ", " port)
 
 	    (set! pinnum (gnetlist:get-attribute-by-pinnumber package pin "pinnumber"))
@@ -80,7 +87,7 @@
 	    (if (string=? label "unknown") 
 		(set! label pinnum)
 		)
-	    (display label port)
+	    (display (pcbfwd:quote-string label) port)
 	    (display ")\n" port)
 	    )
 	  (pcbfwd:component_pins port package (cdr pins))
@@ -96,7 +103,10 @@
 	     (footprint (gnetlist:get-package-attribute refdes "footprint"))
 	     )
 
-	(format port "ElementList(Need,~a,~a,~a)~%" refdes footprint value)
+	(format port "ElementList(Need,~a,~a,~a)~%"
+		(pcbfwd:quote-string refdes)
+		(pcbfwd:quote-string footprint)
+		(pcbfwd:quote-string value))
 	(pcbfwd:each-attr refdes pcbfwd:element-attrs port)
 	(pcbfwd:component_pins port refdes (gnetlist:get-pins refdes))
 




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs