Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.66k stars 12.37k forks source link

kpcli.rd: missing resource "File::KDBX" #166174

Closed georgeef closed 5 months ago

georgeef commented 6 months ago

brew gist-logs <formula> link OR brew config AND brew doctor output

> brew config
HOMEBREW_VERSION: 4.2.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: e5fefd73cd97cd36ae3af29551f529ae59b333d6
Last commit: 4 weeks ago
Core tap JSON: 23 Feb 00:33 UTC
Core cask tap JSON: 23 Feb 00:33 UTC
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_NO_AUTO_UPDATE: set
Homebrew Ruby: 3.1.4 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: octa-core 64-bit icelake
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 8.4.0 => /usr/bin/curl
macOS: 14.3.1-x86_64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.3

> brew doctor
[a few warnings about deprecated formulas]
[a few warnings about unlinked kegs]
[no errors; nothing relevant to the issue]
[It doesn't say Your system is ready to brew, but this is not the problem; see the reason below.]

The same issue appears in an arm64 macOS, only the paths are different. In this system I have a recent homebrew installation and brew doctor says Your system is ready to brew.

Verification

What were you trying to do (and why)?

I try to run kpcli (installed by homebrew) with a .kbdx file, which I created with KeePassXC.

The problem is that kpcli 4.0 needs the File::KDBX perl module in order to open .kdbx (KDBX4) files, which is missing in the formula resources. File::KeePass is included, which is needed for .kdb files, but not File::KDBX.

What happened (include all command output)?

kpcli gives an error message when I open a .kdbx file. This is because it cannot find the File::KDBX module. I have installed File::KDBX manually (with cpan), but /usr/local/bin/kpci (the front-end script installed by homebrew) because it sets PERL5LIB to "/usr/local/Cellar/kpcli/4.0_1/libexec/lib:/usr/local/Cellar/kpcli/4.0_1/libexec/lib/perl5". There is no File/KDBX in this path, because it is missing in the formula.

kpcli

KeePass CLI (kpcli) v4.0 is ready for operation. Type 'help' for a description of available commands. Type 'help ' for details on individual commands.

kpcli:/> open foo.kdbx Error opening file: Perl module File::KDBX is required for KDBX4 support. Without it, KDBX4 files can only be imported.

What did you expect to happen?

If I run the kpci-4.0.pl script directly (downloaded from source, exactly the same as the back-end script installed by homebrew - with a fix in the perl executable path in order to make it equivalent to the homebrew script), I can open the same .kbdx file without error. File::KDBX has been installed manually, as before.

kpcli-4.0.pl

KeePass CLI (kpcli-4.0) v4.0 is ready for operation. Type 'help' for a description of available commands. Type 'help ' for details on individual commands.

kpcli-4.0:/> open foo.kdbx Provide the master password: ***** kpcli-4.0:/Root>

Step-by-step reproduction instructions (by running brew commands)

brew install kpcli
kpcli --kdb foo.kdbx
github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.