You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.5 KiB
1.5 KiB
Tasks: Refactor pkg Into Modular Packages
Phase 1: Create pkg/fetch
- 1.1 Create
pkg/fetch/fetch.go - 1.2 Move
AURResponse,AURPackage,PackageInfostructs to fetch - 1.3 Move
buildLocalPkgMap()to fetch asFetcher.buildLocalPkgMap() - 1.4 Move
checkSyncDBs()to fetch asFetcher.checkSyncDBs() - 1.5 Move
resolvePackages()to fetch asFetcher.Resolve() - 1.6 Move AUR cache methods (
ensureAURCache,fetchAURInfo) to fetch - 1.7 Add
New()andClose()to Fetcher - 1.8 Add
ListOrphans()to Fetcher
Phase 2: Refactor pkg/pacman
- 2.1 Remove from pacman.go (now in fetch):
buildLocalPkgMap()checkSyncDBs()resolvePackages()ensureAURCache()fetchAURInfo()AURResponse,AURPackage,PackageInfostructs
- 2.2 Remove
IsDBFresh()andSyncDB()(use validation instead) - 2.3 Update imports in pacman.go to include fetch package
- 2.4 Update
Sync()to usefetch.Fetcherfor resolution - 2.5 Update
DryRun()to callfetcher.ListOrphans()instead of duplicate call - 2.6 Update
CleanupOrphans()to callfetcher.ListOrphans()instead of duplicate call
Phase 3: Clean Up Validation
- 3.1 Keep
validation.CheckDBFreshness()as-is - 3.2 Remove any remaining DB freshness duplication
Phase 4: Verify
- 4.1 Run tests (if any exist)
- 4.2 Build:
go build ./... - 4.3 Verify CLI still works: test dry-run, sync, orphan cleanup