[Bug 270273] cad/kicad: Fix kicad-cli

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 16 Mar 2023 21:28:52 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270273

            Bug ID: 270273
           Summary: cad/kicad: Fix kicad-cli
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: cmt@freebsd.org
          Reporter: porsolic@gmail.com
             Flags: maintainer-feedback?(cmt@freebsd.org)
          Assignee: cmt@freebsd.org

Created attachment 240904
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=240904&action=edit
patch

Patch which enables kicad-cli to work as expected.

Otherwise kicad-cli won't crash, but it will return 2 (which is enum
CLI::EXIT_CODES::ERR_UNKNOWN) and won't work, e.g.:
% kicad-cli sch export pdf file.kicad_sch -o file.pdf
zsh: exit 2     kicad-cli sch export pdf file.kicad_sch -o file.pdf
% echo $?
2

After some debugging, it was found that variable aPdfJob after dynamic_cast
will be NULL. After changing to static_cast variable has normal address.

Tested on FreeBSD -STABLE and -CURRENT and it works - kicad-cli returns 0 and
exports sch/pcb to PDF.

-- 
You are receiving this mail because:
You are the assignee for the bug.