XBPS API example: list pkgs in a repo (emulating pacman -Sl repo)
In this post I’ll show another simple example of the XBPS API that allows
you to list all packages in a repository (local or remote); the output
emulates the pacman -Sl repo command from the Archlinux distribution:
To compile the example you’ll have to install some additional packages:
# xbps-install -Sy gcc libxbps-devel pkg-config
And then to compile the C source code:
$ cc `pkg-config --cflags --libs libxbps` list_pkgs_in_repo.c
You can then specify a repository url to list all stored packages in this
repository: