xbps icon indicating copy to clipboard operation
xbps copied to clipboard

bin/xbps-repodb: add new tool to manage multiple repositories at once

Open Duncaen opened this issue 5 years ago • 8 comments

This currently only supports -p/--purge to remove obsolete binary package files from repositories with the awareness that different noarch package version can co-exist within a repository in different architectures repository indexes.

Duncaen avatar May 12 '20 11:05 Duncaen

This pull request introduces 1 alert when merging 0aa996b0ae4e5455a28d5110e55224548abed3d6 into 15941299ff677c8a17dbb7b73b3f811eba7cd69c - view on LGTM.com

new alerts:

  • 1 for Missing header guard

lgtm-com[bot] avatar May 12 '20 12:05 lgtm-com[bot]

I have another use case. I accidentially just added *.mips-musl.xbps packages to my x86_64-repodata, because I forgot to prepend XBPS_ARCH=mips-musl to the command. DUH! Could we make this tool remove (optionally?) wrong architecture packages from a repodata file?

pullmoll avatar May 12 '20 17:05 pullmoll

I think its better to not allow xbps-rindex -a to add different architectures packages anymore, I can't think of any usecase where this would be desirable and this would make this mode not really required.

Duncaen avatar May 12 '20 17:05 Duncaen

Hmm this shouldn't have been possible, xbps-rindex -a already checks the architecture: https://github.com/void-linux/xbps/blob/15941299ff677c8a17dbb7b73b3f811eba7cd69c/bin/xbps-rindex/index-add.c#L271-L276

Duncaen avatar May 12 '20 18:05 Duncaen

My bad. I didn't see the error message and for *.noarch.xbps it succeeded, which made me think it succeeded for all packages. Inspecting index.plist there is no <string>mips-musl</string> so everything is ok.

pullmoll avatar May 12 '20 19:05 pullmoll

My plan for xbps-repodb is to eventually move all the staging stuff to it to allow it to maintain the stage over multiple repositories and make xbps-rindex a tool for "simple" local repositories.

  • xbps-rindex loses some of its functionality.
    • signing of packages moves to xbps-repodb (this is a task for published repositories).
    • --clean could stay to allow simple cleaning of stagedata.
    • --remove-orphans may stay for simple usecases, but xbps-repodb --purge is prefered.
  • xbps-repodb becomes the publishing tool for repositories.
    • it checks the stagedata and selectively moves sets of packages from each stagedata into the corresponding repodata when all dependencies and shared libraries can be satisfied.
    • sign repodata.
    • sign packages.
    • maybe maintain a new filesdb in the future?
    • maybe also maintain a man page dump?

xbps-src would not be changed it would continue to just use xbps-rindex to add new packages to *-stagedata. xbps-repodb would be "privileged" ans has access to secret keys so it can sign repodata and packages. It should be "fast" and non-disruptive to run it in a cronjob to have the secret keys owned by a user separate from xbps-src.

Duncaen avatar May 12 '20 19:05 Duncaen

Great that you found time to start working on this!

Chocimier avatar May 12 '20 20:05 Chocimier

Is it assured that for each stagedata there is repodata at same time?

Chocimier avatar May 13 '20 16:05 Chocimier