What is the source of `/usr/bin/repo-add`?

Hi! I am currently packaging up a bunch of packages, to be distributed in a custom repository. A script runs makepkg, then issues a repo-add command.

I hit a bug which crashed repo-add and tried to debug it:

  1. Looking at /usr/bin/repo-add I found it to be an ELF file.
  2. pacman -Qo told me it belongs to pacman.
  3. I navigated to the CachyOS pacman repository.
  4. I found repo-add.sh.in and its meson.build.
  5. I looked at the PKGBUILD.
  6. I was at a loss because I found no connection between the shell script from the repository and the ELF file on my system.

Can you enlighten me, what the /usr/bin/repo-add binary is and how it is produced?

(The bug in question seems to have been caused by me placing two package versions of the same package and calling repo-add once. Running repo-add for each package file mitigated the issue, although I could also make sure that there is only one package version present when doing a bulk repo-add call.)

1 Like