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

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-138-gf1104b2)



The branch, master has been updated
       via  f1104b263b212b67576bfd1e73fa5036ee7f233d (commit)
      from  b215d134d1271c6a1723e406f1a0b67be8f59bc6 (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
=========

 utils/src/gsch2pcb.c |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)


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

commit f1104b263b212b67576bfd1e73fa5036ee7f233d
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Aug 18 12:18:06 2008 +0100

    gsch2pcb: Add --gnetlist-arg option to pass extra gnetlist arguments
    
    The "gnetlist-arg" directive also works in gsch2pcb project files.

:100644 100644 3233485... 9e7d2a0... M	utils/src/gsch2pcb.c

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

commit f1104b263b212b67576bfd1e73fa5036ee7f233d
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Aug 18 12:18:06 2008 +0100

    gsch2pcb: Add --gnetlist-arg option to pass extra gnetlist arguments
    
    The "gnetlist-arg" directive also works in gsch2pcb project files.

diff --git a/utils/src/gsch2pcb.c b/utils/src/gsch2pcb.c
index 3233485..9e7d2a0 100644
--- a/utils/src/gsch2pcb.c
+++ b/utils/src/gsch2pcb.c
@@ -79,7 +79,8 @@ typedef struct
 
 static GList	*pcb_element_list,
 				*element_directory_list,
-				*extra_gnetlist_list;
+				*extra_gnetlist_list,
+				*extra_gnetlist_arg_list;
 
 static gchar	*schematics,
 				*basename;
@@ -169,11 +170,30 @@ run_gnetlist(gchar *pins_file, gchar *net_file, gchar *pcb_file, gchar *basename
 	time_t		mtime;
 	static const gchar *gnetlist = NULL;
 
+        /* Prepend the gnetlist arguments (including the list of schematics)
+         * with those the user has specified with gnetlist-arg directives */
+        if (extra_gnetlist_arg_list != NULL) {
+          int count = 0;
+          gchar **str_array =
+            g_new0 (char *, 2 + g_list_length (extra_gnetlist_arg_list));
+          for (list = extra_gnetlist_arg_list;
+               list != NULL;
+               list = g_list_next(list)) {
+            str_array[count++] = list->data;
+          }
+          str_array[count++] = args;
+          args = g_strjoinv (" ", str_array);
+          g_free (str_array);
+        } else {
+          args = g_strdup (args);
+        }
+
 	/*
 	 * Allow the user to specify a full path or a different name for
 	 * the gnetlist command.  Especially useful if multiple copies
 	 * are installed at once.
 	 */
+
 	if (gnetlist == NULL)
 		gnetlist = g_getenv ("GNETLIST");
 	if (gnetlist == NULL)
@@ -271,6 +291,7 @@ run_gnetlist(gchar *pins_file, gchar *net_file, gchar *pcb_file, gchar *basename
 		if (verbose)
 			printf(SEP_STRING);
 		}
+        g_free (args);
 	}
 
 static gchar *
@@ -1221,6 +1242,9 @@ parse_config(gchar *config, gchar *arg)
 	else if (!strcmp(config, "gnetlist"))
 		extra_gnetlist_list =
 				g_list_append(extra_gnetlist_list, g_strdup(arg));
+	else if (!strcmp(config, "gnetlist-arg"))
+		extra_gnetlist_arg_list =
+				g_list_append(extra_gnetlist_arg_list, g_strdup(arg));
 	else if (!strcmp(config, "empty-footprint"))
 		empty_footprint_name = g_strdup(arg);
 	else
@@ -1334,6 +1358,7 @@ static gchar *usage_string1 =
 "   --gnetlist backend    A convenience run of extra gnetlist -g commands.\n"
 "                         Example:  gnetlist partslist3\n"
 "                         Creates:  myproject.partslist3\n"
+"   --gnetlist-arg arg    Allows additional arguments to be passed to gnetlist.\n"
 " --empty-footprint name  See the project.sample file.\n"
 "\n"
 "options (not recognized in a project file):\n"




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