On Fri, Aug 22, 2008 at 2:56 PM, Nagy Gabor <ngaba@bibl.u-szeged.hu> wrote:
First, thanks for the feedback!
0. I don't like this _alpm_pkg_compare_versions() function at all, it has some annoying warning messages (why is the "forcing upgrade..." message important?), these reduce its usability (hardwired "upgrade" word etc.). This function is just a vercmp + force check + printing some (useless?) warnings. (The second "downgrade" warning also seems a bit odd in "-S target" operation because of mentioning the repo.)
I agree that these warning messages are annoying and rather useless. However, I like the idea of having a simple wrapper to vercmp handling the force flag (and maybe the epoch idea in 10 years :P) Finally, why is it odd to mention the repo?
1. After your patch we won't display warning in 2) case neither (as you wrote in patch description). I am not sure this is better. I would simply inform user about both downgrade (but not in pkg_compare_versions!) and reinstall instead.
Could you be much more precise here? There are 3 different values returned by compare_versions, and 2 values for the needed flag, which makes 6 different combination. downgrade only applies when compare_versions == -1 and with both values of needed (because of point 2. below) reinstall happens when compare_versions == 0 and needed == 0 So you want to display these messages only in these cases? And nothing in the other cases? (like skipping when compare_versions == 0 and needed == 1)
2. The patch silently modifies (fixes?) --needed behavior (probably this is why you changed its description, but it wasn't clear to me first): Before your patch --needed prevented us from _downgrade_ too, now it will allow it.
Good point, I made this patch a while ago and I don't even know if I realized that. At least I don't remember anymore. Thinking about it now, I prefer the new behavior and see my change as a fix. But I agree this should clearly appear in the commit log.