www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2023/03/21/16:04:09

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20210112; t=1679427839;
h=mime-version:message-id:in-reply-to:date:subject:to:user-agent
:references:from:from:to:cc:subject:date:message-id:reply-to;
bh=8++n1Y0odiBypwgRJ5Fvq5ICKRswdyk0dofd9LORt5Y=;
b=PsKahb1kd3qecM06uHzsjjVewfA6YLFOqM1+c9+QGQPA9lS/zRi3s0oCUwVJNzRSO0
ESr6Lss+3/1uoEfnwIC6Yns/aE+4ze8Un1OtO4TuY+Pw6tQAbUJeDHZR3/j7Ag2I8MWA
0RMZR0LDmjQvB6eC+Yk52SB/U4n0wwzkLKLkKj/3M4H2dcXFWHkblM7lcuWD96gmtEU4
xXb7XT/oqyvxLx70q458VriFS7m7TBqXEliWcF9jazAoUuQLVVXUtcL3kr4EruKYeABb
NOJJNusAA34vLWDYeaZuNW15sH2c9UkBa0XB4o8iBzXoAibo67NuumPrV6FpafV0AKcr
FJIg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112; t=1679427839;
h=mime-version:message-id:in-reply-to:date:subject:to:user-agent
:references:from:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to;
bh=8++n1Y0odiBypwgRJ5Fvq5ICKRswdyk0dofd9LORt5Y=;
b=WFnYO8h7Xa3gcIOrpW3Cjad/pQoRf3SFBrZM1iGde8mngtyDt+iVBu8xOeB0+/jo7N
epWP5rk8xIk7gjT/8doRUChC9ZyoPFE7fEyH44c68q8f4MfDAXcy9T4FasSWAy+Fys5d
sV4TtVozzQkuuZnJ18jTxX70v41wISPTl6pvMMn3DzUHfB+BlRthpJn2EjcvO6c1Y/MI
ec7cOsXsUR7qYSemCyvz+AHVOU8FLEJBzn9JVGZxuu8Ih4vw/ateuevUTPaedXdrR3Hk
cjHsi/K6ezx+FUUo8aYk9EAddyUJXxoBp4vDOqk4K+D4tx2qUNqMlmlgkiZHcyT4ee6i
4hYg==
X-Gm-Message-State: AO0yUKWX43aBVaqHMSisdIOk165mm4wOKERUEjRt1nCJYhBIoIgT47lN
3AAffLDLZ7rKDFgJW8CzP5Drl4jZ00k=
X-Google-Smtp-Source: AK7set80S/SAYUfrgSd0TvW942C1FoOTQ/hXti6z9xL4sQRV2nOUDYCor/WiLJawghRqJPVzVAeV3Q==
X-Received: by 2002:ac2:59ce:0:b0:4dc:7ff4:83f9 with SMTP id x14-20020ac259ce000000b004dc7ff483f9mr1492263lfn.16.1679427838610;
Tue, 21 Mar 2023 12:43:58 -0700 (PDT)
From: "vzh (vzhbanov AT gmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
X-Google-Original-From: vzh <vzh AT lepton>
References: <20230319120044 DOT 4EA0585F61DE AT turkos DOT aspodata DOT se>
<20230320112351 DOT 68F568497643 AT turkos DOT aspodata DOT se>
User-agent: mu4e 1.8.11; emacs 28.2
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] Unknown config key
Date: Tue, 21 Mar 2023 22:32:35 +0300
In-reply-to: <20230320112351.68F568497643@turkos.aspodata.se>
Message-ID: <87355xyjnm.fsf@lepton.mail-host-address-is-not-set>
MIME-Version: 1.0
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Hi Karl,

"karl AT aspodata DOT se [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com> writes:

> Karl:
>> $ git branch -v
>> * (HEAD detached at
>> vzh/sch2pcb-rewrite-sch2pcb-add-elements-in-scheme) 60d7148f0
>> sch2pcb: Rewrite sch2pcb_add_elements() in Scheme.
> ...
>>   I get (after make install):
>> $ lepton-sch2pcb styrkort.sch 
>> Unknown config key: "."
>> Unknown config key: "/home/karl/git/openhw/share/pcb/"
>> Unknown config key: "/usr/share/pcb/pcblib-newlib/"
>> ...
>
>  Ok, I found the file:
> $ cat ~/.config/lepton-eda/gsch2pcb 
> d .
> d /home/karl/git/openhw/share/pcb/
> d /usr/local/share/pcb/pcblib-newlib/
> d /usr/local/share/pcb/newlib/
>
>  In geda-gaf, ~/.gEDA/gsch2pcb is one of three "default"
>  project files:
> $ grep -B1 -A17 ^load_extra_project_files geda-gaf/utils/src/gsch2pcb.c 
> static void
> load_extra_project_files (void)
> {
>   gchar *path;
>   static gboolean done = FALSE;
>
>   if (done)
>     return;
>
>   load_project ("/etc/gsch2pcb");
>   load_project ("/usr/local/etc/gsch2pcb");
>
>   path = g_build_filename ((gchar *) g_get_home_dir (), ".gEDA",
>                            "gsch2pcb", NULL);
>   load_project (path);
>   g_free (path);
>
>   done = TRUE;
> }
>
> load_project() reads lines, splitting it in a config and a arg variable,
> and then calls parse_config() (line 1199-1576).
>
> parse_config() strcmp's the config variable, it can be either a long or
> a short string as in e.g. (line 1173-1180):
>
>   if (!strcmp (config, "elements-dir") || !strcmp (config, "d")) {
>     gchar *elements_dir = expand_dir (arg);
>     if (verbose > 1)
>       printf ("\tAdding directory to file element directory list: %s\n",
>               elements_dir);
>     element_directory_list =
>       g_list_prepend (element_directory_list, elements_dir);
>   } else if (!strcmp (config, "output-name") || !strcmp (config, "o"))
>
> So the "d" in my file adds a directory where to search for footprint
> (element) files.
>
> ///
>
>  The source of lepton-sch2pcb seems to be in:
> ./liblepton/include/liblepton/sch2pcb.h
> ./liblepton/scheme/lepton/ffi/sch2pcb.scm
> ./liblepton/src/sch2pcb.c
> ./tools/sch2pcb/lepton-sch2pcb.scm
>
> Your parse-config is in tools/sch2pcb/lepton-sch2pcb.scm (line 322-360).
> Line 359 has the error message:
>                  (G_ "Unknown config key: ~S\n")
>
> In line 335-341, you do the matching for elements-dir, but you
> are ignoring the short, one letter keys:
>       ("elements-dir"
>        (let ((elements-dir (expand-env-variables value)))
>          (when (> (sch2pcb_get_verbose_mode) 1)
>            (format #t
>                    "\tAdding directory to file element directory list: ~A\n"
>                    elements-dir))
>          (sch2pcb_element_directory_list_prepend (string->pointer elements-dir))))
>
> Changing the line with the pattern to:
>       ((or "elements-dir" "d")
> solves it for the "d" key.
>
> Patch attached.

This behavior is intentional, sorry.  The commit d8fff1e9c already
present in the repository reads:

  sch2pcb: Rewrite sch2pcb_parse_config() in Scheme.
  
  Unlike in previous C code, processing of short options is dropped
  as they were intended only for using as command line options and
  other using is not documented.

So I'm not going to change it.  Moreover, the project rc files are
subject to be replaced with standard lepton configuration files,
lepton.conf and such.  What should be done, IMO, is to clearly state
this in lepton NEWS and manuals.

With best regards,
  Vladimir

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019