Hi! On Mon, 2019-07-01 at 11:19:59 +0200, Marketa Calabkova wrote: > I am afraid this bug got forgotten somehow... could you please look at > it and give some answers?
Ah, sorry, this was filed against a non-existent package, and when reassigned, it was not CCed. On Tue, 2019-04-02 at 12:40:57 +0200, Marketa Calabkova wrote: > Package: update-alternatives > Version: 1.18.23-1.19.0 > In SUSE we use update-alternatives in our packages. When using > update-alternatives in %postun (e. g. what should happen after > uninstalling the package), the following warnings are emitted: > > update-alternatives: warning: alternative /usr/bin/virtualenv-3.6 (part of > link group virtualenv) doesn't exist; removing from list of alternatives > update-alternatives: warning: /etc/alternatives/virtualenv is dangling; it > will be updated with best choice > update-alternatives: using /usr/bin/virtualenv-2.7 to provide > /usr/bin/virtualenv (virtualenv) in auto mode > > This is because update-alternatives first checks if it must modify > the auto-selection, and discovers that key files are missing so it > auto-corrects the alternative choice. > ...which is what I was telling it to do in the first place. I checked this yesterday, and silencing the first warning would be trivial, the second one might need more code shuffling. But I'm actually wondering now whether that would be the correct thing to do at all. The problem I can see, is that this is really dealing with a broken alternative and symlinks, so I think the user should be notified, but will ponder about it a bit more. In any case ISTM that the real problem here is how u-a is being used in SUSE, which is not how u-a expects it to be operated. I'd say you'd need to switch to call it from %preun, which is what we are doing in Debian (removal is executed in prerm). This makes sure the alternative gets removed before the files disappear, so there's never a broken alternative (making the installation more robust), and u-a never sees that breakage as something that needs fixing, so no warnings will get emitted. The above is documented in the man page, I guess I could improve it to cover the rpm case. Thanks, Guillem