bin/xbps-repodb: add new tool to manage multiple repositories at once
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.
This pull request introduces 1 alert when merging 0aa996b0ae4e5455a28d5110e55224548abed3d6 into 15941299ff677c8a17dbb7b73b3f811eba7cd69c - view on LGTM.com
new alerts:
- 1 for Missing header guard
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?
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.
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
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.
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-rindexloses some of its functionality.- signing of packages moves to
xbps-repodb(this is a task for published repositories). -
--cleancould stay to allow simple cleaning of stagedata. -
--remove-orphansmay stay for simple usecases, butxbps-repodb --purgeis prefered.
- signing of packages moves to
-
xbps-repodbbecomes 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.
Great that you found time to start working on this!
Is it assured that for each stagedata there is repodata at same time?