yay/pkg/db
Andrew Geng d33bf8841d
Fix yay -Sc wiping ~/.cache/yay on 3rd question. (#2175)
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
4626a0409c.
2023-05-22 20:34:51 +00:00
..
ialpm Fix yay -Sc wiping ~/.cache/yay on 3rd question. (#2175) 2023-05-22 20:34:51 +00:00
mock Implement tests for -Qu/q (#2156) 2023-05-15 10:33:12 +02:00
executor.go chore(upgrade): add makedep explain to the upgrade menu (#2110) 2023-04-11 16:41:34 +00:00
types.go add dep graph for local install 2022-09-06 23:38:47 +02:00