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

gEDA-cvs: gaf.git: branch: master updated (1.6.1-20100214-222-g77621ac)



The branch, master has been updated
       via  77621ac14298e1ec41a994a47ce10e1104fa5cc4 (commit)
       via  942226e52f706afd9c0c130672c89e169510e794 (commit)
       via  ae45df48397e579284a1591bb0ff350b5f3f287a (commit)
      from  ca2741e817c3f8b16e396de9eae1676bc1c612c1 (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
=========

 gnetlist/docs/gnetlist.1   |    6 ++++--
 gnetlist/include/globals.h |    1 +
 gnetlist/src/globals.c     |    1 +
 gnetlist/src/gnetlist.c    |   41 +++++++++++++++++++++++++++--------------
 gnetlist/src/parsecmd.c    |    9 +++++++--
 5 files changed, 40 insertions(+), 18 deletions(-)


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

commit 77621ac14298e1ec41a994a47ce10e1104fa5cc4
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gnetlist: Fail more usefully if backend can't be found in load path.

:100644 100644 f068323... 30354ad... M	gnetlist/src/gnetlist.c

commit 942226e52f706afd9c0c130672c89e169510e794
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gnetlist: Fail more usefully if no schematics specified.
    
    Make sure exit status if no schematics are specified is non-zero, and
    make it more obvious why things have failed.

:100644 100644 952429e... f068323... M	gnetlist/src/gnetlist.c

commit ae45df48397e579284a1591bb0ff350b5f3f287a
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gnetlist: Add `--list-backends' option. Remove `-g help'.
    
    Instead of overloading the `-g' option to obtain a list of available
    backends, provide a distinct option.

:100644 100644 eb6b847... 784ea3e... M	gnetlist/docs/gnetlist.1
:100644 100644 0fdb54e... 90425a2... M	gnetlist/include/globals.h
:100644 100644 8514b66... ee6101c... M	gnetlist/src/globals.c
:100644 100644 a4df542... 952429e... M	gnetlist/src/gnetlist.c
:100644 100644 d5dda61... 1fba9a9... M	gnetlist/src/parsecmd.c

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

commit 77621ac14298e1ec41a994a47ce10e1104fa5cc4
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gnetlist: Fail more usefully if backend can't be found in load path.

diff --git a/gnetlist/src/gnetlist.c b/gnetlist/src/gnetlist.c
index f068323..30354ad 100644
--- a/gnetlist/src/gnetlist.c
+++ b/gnetlist/src/gnetlist.c
@@ -257,13 +257,28 @@ void main_prog(void *closure, int argc, char *argv[])
     scm_primitive_load_path (scm_from_locale_string ("gnetlist.scm"));
 
     if (guile_proc) {
-        /* Load the backend scm file */
-        str = g_strdup_printf("gnet-%s.scm", guile_proc);
-        scm_primitive_load_path (scm_from_locale_string (str));
-        g_free (str);
+      SCM s_backend_path;
+
+      /* Search for backend scm file in load path */
+      str = g_strdup_printf("gnet-%s.scm", guile_proc);
+      s_backend_path = scm_sys_search_load_path (scm_from_locale_string (str));
+      g_free (str);
+
+      /* If it couldn't be found, fail. */
+      if (scm_is_false (s_backend_path)) {
+        fprintf (stderr, "ERROR: Could not find backend `%s' in load path.\n",
+                 guile_proc);
+        fprintf (stderr,
+                 "\nRun `%s --list-backends' for a full list of available backends.\n",
+                 argv[0]);
+        exit (1);
+      }
+
+      /* Load backend code. */
+      scm_primitive_load (s_backend_path);
 
-        /* Evaluate second set of Scheme expressions. */
-        g_scm_eval_protected (post_backend_list, scm_current_module ());
+      /* Evaluate second set of Scheme expressions. */
+      g_scm_eval_protected (post_backend_list, scm_current_module ());
     }
 
     s_traverse_init();

commit 942226e52f706afd9c0c130672c89e169510e794
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gnetlist: Fail more usefully if no schematics specified.
    
    Make sure exit status if no schematics are specified is non-zero, and
    make it more obvious why things have failed.

diff --git a/gnetlist/src/gnetlist.c b/gnetlist/src/gnetlist.c
index 952429e..f068323 100644
--- a/gnetlist/src/gnetlist.c
+++ b/gnetlist/src/gnetlist.c
@@ -243,9 +243,9 @@ void main_prog(void *closure, int argc, char *argv[])
     /* free(cwd); - Defered; see below */
 
     if (argv[argv_index] == NULL) {
-        fprintf(stderr,
-                "\nERROR! You must specify at least one filename\n\n");
-        usage(argv[0]);
+        fprintf (stderr, "ERROR: No schematics files specified for processing.\n");
+        fprintf (stderr, "\nRun `%s --help' for more information.\n", argv[0]);
+        exit (1);
     }
 
     g_set_project_current(pr_current);

commit ae45df48397e579284a1591bb0ff350b5f3f287a
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gnetlist: Add `--list-backends' option. Remove `-g help'.
    
    Instead of overloading the `-g' option to obtain a list of available
    backends, provide a distinct option.

diff --git a/gnetlist/docs/gnetlist.1 b/gnetlist/docs/gnetlist.1
index eb6b847..784ea3e 100644
--- a/gnetlist/docs/gnetlist.1
+++ b/gnetlist/docs/gnetlist.1
@@ -37,12 +37,14 @@ Prepend \fIDIRECTORY\fR to the list of directories to be searched for
 Scheme files.
 .TP 8
 \fB-g\fR \fIBACKEND\fR
-Specify the backend to be used. Use `\-g help' to display a list of
-available backends.
+Specify the netlist backend to be used.
 .TP 8
 \fB-O\fR \fISTRING\fR
 Pass an option string to the backend.
 .TP 8
+\fB--list-backends\fR
+Print a list of available netlist backends.
+.TP 8
 \fB-o\fR \fIFILE\fR
 Specify the filename for the generated netlist.  By default, output is
 directed to `output.net'.
diff --git a/gnetlist/include/globals.h b/gnetlist/include/globals.h
index 0fdb54e..90425a2 100644
--- a/gnetlist/include/globals.h
+++ b/gnetlist/include/globals.h
@@ -28,6 +28,7 @@ extern NETLIST *netlist_head;
 extern NETLIST *graphical_netlist_head; /* Special objects with 
 					   graphical=1 attribute */
 extern char *guile_proc;
+extern int list_backends;
 extern int verbose_mode;
 extern int interactive_mode;
 extern int include_mode;
diff --git a/gnetlist/src/globals.c b/gnetlist/src/globals.c
index 8514b66..ee6101c 100644
--- a/gnetlist/src/globals.c
+++ b/gnetlist/src/globals.c
@@ -44,6 +44,7 @@ char *guile_proc=NULL;
 
 
 /* command line arguments */
+int list_backends=FALSE;
 int verbose_mode=FALSE;
 int interactive_mode=FALSE;
 int quiet_mode=FALSE;
diff --git a/gnetlist/src/gnetlist.c b/gnetlist/src/gnetlist.c
index a4df542..952429e 100644
--- a/gnetlist/src/gnetlist.c
+++ b/gnetlist/src/gnetlist.c
@@ -195,11 +195,9 @@ void main_prog(void *closure, int argc, char *argv[])
 
     s_rename_init();
 
-    if(guile_proc!=NULL) {
-        if(!strcmp(guile_proc, "help")) {
-                gnetlist_backends(pr_current);
-                exit(0);
-            }
+    if(list_backends) {
+      gnetlist_backends(pr_current);
+      exit (0);
     }
 
     /* Evaluate the first set of Scheme expressions before we load any
diff --git a/gnetlist/src/parsecmd.c b/gnetlist/src/parsecmd.c
index d5dda61..1fba9a9 100644
--- a/gnetlist/src/parsecmd.c
+++ b/gnetlist/src/parsecmd.c
@@ -55,6 +55,7 @@ extern int optind;
 struct option long_options[] =
   {
     {"help", 0, 0, 'h'},
+    {"list-backends", 0, &list_backends, TRUE},
     {"nomunge", 0, 0, 'n'},
     {"verbose", 0, 0, 'v'},
     {"version", 0, 0, 'V'},
@@ -84,12 +85,11 @@ void usage(char *cmd)
 "  -m FILE         Load Scheme file after loading backend.\n"
 "  -c EXPR         Evaluate Scheme expression at startup.\n"
 "  -i              Enter interactive Scheme REPL after loading.\n"
+"  --list-backends Print a list of available netlist backends.\n"
 "  -h, --help      Help; this message.\n"
 "  -V, --version   Show version information.\n"
 "  --              Treat all remaining arguments as filenames.\n"
 "\n"
-"A list of available backends can be obtained using `-g help'.\n"
-"\n"
 "Backend-specific options:\n"
 "  -e, --embedd    Force embedding of .include file contents (spice-sdb).\n"
 "  -n, --nomunge   Do not autocorrect component refdes (spice-sdb).\n"
@@ -151,6 +151,11 @@ parse_commandline (int argc, char *argv[])
 #endif
     switch (ch) {
 
+    case 0:
+      /* This is a long-form-only flag option, and has already been
+       * dealt with by getopt_long(). */
+      break;
+
     case 'v':
       backend_params = g_slist_append(backend_params, "verbose_mode");
       verbose_mode = TRUE;




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