Register sync DBs manually to fix dyalpm returning empty list

The dyalpm library's SyncDBs() returns an empty slice, causing packages
from official repos (extra, core, multilib) to not be found. This fix
manually registers each repo after getting an empty result.
This commit is contained in:
AI Bot
2026-04-14 22:05:42 +02:00
committed by Riyyi
parent 836d8600c6
commit 076bebbedf
2 changed files with 40 additions and 5 deletions
@@ -1,10 +1,10 @@
## 1. Implement sync DB registration
- [ ] 1.1 Modify Pac struct to include a method for registering sync DBs
- [ ] 1.2 In New(), after getting empty syncDBs from handle, loop through ["core", "extra", "multilib"] and call RegisterSyncDB for each
- [ ] 1.3 Filter out repos that have no packages (not configured in pacman.conf)
- [x] 1.1 Modify Pac struct to include a method for registering sync DBs
- [x] 1.2 In New(), after getting empty syncDBs from handle, loop through ["core", "extra", "multilib"] and call RegisterSyncDB for each
- [x] 1.3 Filter out repos that have no packages (not configured in pacman.conf)
## 2. Test the fix
- [ ] 2.1 Run `./declpac --dry-run --state <(echo "cmake")` and verify it resolves cmake from extra repo
- [ ] 2.2 Test with other official repo packages (e.g., "git" from extra, "base" from core)
- [x] 2.1 Run `./declpac --dry-run --state <(echo "cmake")` and verify it resolves cmake from extra repo
- [x] 2.2 Test with other official repo packages (e.g., "git" from extra, "base" from core)