" -> Unable to find a base package." is not informative enough (pacdiff)
I was faced with the error message -> Unable to find a base package.
when trying to merge.
After troubleshooting and finding I have the packages in the cache (for vast majority of pacnew files I get this error, but not for some), I needed to look at the source of the ´pacdiff´ to find out what is going on. I've set up pacman so that it doesn't keep too much hdd space, as I have a fast internet connection in any case, and the need to downgrade comes by very seldomly, and very rarely breaks my internet connection.
For vast majority of packages I only have one package in the cache - I must admit, that many of the pacnew files are old. Pacdiff actually requires at least two packages and chooses the second to newest one from the cache?
I feel like the error message should be more descriptive, and the behavior should be documented, so that users don't set up a too conservative cache cleaning (with fast internet connections, on a rolling-release distro, it doesn't make much sense for many use cases to keep any older packages taking up disk space).
Optimally, pacdiff could fetch an older package when one is not in cache. Maybe even a version which is as old as the last time the configuration file has been updated (the second-to-newest might not be the one actually containing the configuration file the current file is based on, if the admin has been lazy =) ).
TL;DR - steps to reproduce:
- run pacdiff
- try to run some [M]erge
Observed results:
-> Unable to find a base package.
Expected results:
Either:
- Give an error message which is more descriptive; e.g. "Unable to find older base package to base merge on.", or
- and, optionally ask user, and automatically fetch an older package to make the merge
Cheers!