Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix yay -Sc wiping ~/.cache/yay on 3rd question.
If you answer yes to :: Do you want to remove all other AUR packages from cache? [Y/n] then we run cleanAUR(), intending to remove subdirectories of ~/.cache/yay that do not share a name with installed packages not found in the sync repositories. Where this was going wrong was cleanAUR() was getting an empty map from dbExecutor.InstalledRemotePackages()---because InstalledRemotePackages only recomputes its result if installedRemotePkgMap is nil, whereas NewExecutor initialized it to an empty map. The symptom was it emptied my ~/.cache/yay. We do want a non-nil, empty installedRemotePkgMap to block recomputing (that is, to indicate the user really has no remote packages), so now NewExecutor initializes it to nil, and getPackageNamesBySource is responsible for making sure it's non-nil before writing to it. Fixes #2152, which seems to have been introduced in 4626a04.
- Loading branch information