Index: read_net.c =================================================================== --- read_net.c (revision 29525) +++ read_net.c (revision 29526) @@ -242,9 +242,34 @@ static int eeschema_support_prio(pcb_plug_import_t *ctx, unsigned int aspects, const char **args, int numargs) { - if (aspects != IMPORT_ASPECT_NETLIST) - return 0; /* only pure netlist import is supported */ - return 20; + unsigned int n, good = 0; + FILE *f; + + if ((aspects != IMPORT_ASPECT_NETLIST) && (numargs == 1)) + return 0; /* only pure netlist import is supported with a single input file */ + + f = pcb_fopen(&PCB->hidlib, args[0], "r"); + if (f == NULL) + return 0; + + for(n = 0; n < 32; n++) { + char *s, line[1024]; + s = fgets(line, sizeof(line), f); + if (s == NULL) + break; + while(isspace(*s)) s++; + if (strstr(s, "(design") != NULL) + good |= 1; + else if (strstr(s, "(export") != NULL) + good |= 2; + if (good == (1|2)) { + fclose(f); + return 100; + } + } + + fclose(f); + return 0; }