Pamac info, getting optional dependency package names?

Hello,

Seeking a way to query pamac to get the actual package names of optional dependencies. pamac info does not (necessarily) return this, correct?

e.g. pamac info vim

Name                  : vim
Version               : 9.1.1734-1
Description           : Vi Improved, a highly configurable, improved version of the vi text editor
URL                   : https://www.vim.org
Licenses              : custom:vim
Repository            : extra
Installed Size        : 5.2 MB
Groups                : --
Depends On            : vim-runtime=9.1.1734-1 gpm acl glibc libgcrypt zlib
Optional Dependencies : python: Python language support [Installed]
                        ruby: Ruby language support
                        lua: Lua language support [Installed]
                        perl: Perl language support [Installed]
                        tcl: Tcl language support [Installed]

(I am assuming ‘ruby language support’ != ruby). Cannot find a ‘ruby language support’ pkg.

Context:

Am trying to script provisioning in ansible, and looking for an unattended way to install optional dependencies. A separate pamac install will work, but I need the actual package name.

Hi @jtuyreqwertyu,

As I understand it, the name of the dependency is befo4re the colon, followed by the description,

So, using your example of ruby, the name of the package is ruby and it provides “Ruby language support”.

2 Likes

What @Mirdarthos said - before the colon is the package name, after the colon is the package description.
python, ruby, lua, perl, tcl in this example.
See also the Arch website where the repo packages and the AUR packages are described:

Arch Linux - vim 9.1.1841-1 (x86_64)

You find 25 dependencies for this package, the above five of them being optional,
and many more dependencies needed to be able to build the package,
but not needed to be present after the build (make dependencies).

There is a package called pacdep which will probably do what you need it to, though it queries pacman and not pamac.

It is not available in Manjaro repo’s, but can still be found in the AUR, albeit quite old and seemingly unmaintained.

Syntax is simple;

pacdep -oppp <package-name>

which produces output similar to:

...
Optional dependencies:    n.nn MiB
  extra/dependency-name     n.nn MiB
  extra/dependency    n.nn MiB
...

(re-created as I do not have pacdep installed)

As you can see the optional dependency package names output in a format that you can likely work with; assuming it still builds without issue.

I hope this might be workable in the absence of other options.

Regards.

Perhaps easier to parse/postprocess than pamac info output is
pacman output

pacman -S --print-format %O vim

will give you:
python: Python language support ruby: Ruby language support lua: Lua language support perl: Perl language support tcl: Tcl language support

It’s from the

TRANSACTION OPTIONS

section in

man pacman

or you parse the local database for the package:

/var/lib/pacman/local/vim-9.1.1734-1/desc

and get

...
%OPTDEPENDS%
python: Python language support
ruby: Ruby language support
lua: Lua language support
perl: Perl language support
tcl: Tcl language support

...