The given scriptlet will rename the old directory in order to preserve anything in it. But it does this always, even if the directory is empty. It seems that os.remove in Lua will error if the directory is not empty, so should it at least attempt it?
Also, the rename can produce names other than .rpmmoved, but the %ghost instructions only mention the one. Should I not bother ghosting the possibly numbered renames? And how long should I keep the %ghost around for?
Frankly, I'm reluctant to poke at this without consultation with RPM upstream. I believe that's where the current recommendation comes from, and the issue is quite subtle.
I'll talk to some folks to see if the current recommendations differ from what we have.
Metadata Update from @tibbs:
- Issue tagged with: meeting
So RPM's recommendations haven't really changed here.
It indeed shouldn't hurt to try and remove the directory; if it's empty, it will go away and we then don't have to bother with the .rpmmoved dance.
Worrying about %ghosting additional .rpmmoved directories seems to me to be worrying for the sake of worrying. This situation is vanishingly rare. Are you really moving back and forth from a directory to a file so frequently that this has become an issue?
I'd say that the %ghost should be kept for the usual two Fedora releases, but I can see an argument for keeping it forever since it won't actually go away unless the local admin does something about it.
It might be a good idea to require a release note or specific upgrade note telling admins about the .rpmmoved directories that might be created.
We should consider hiding this complexity behind macros. There's no reason for anyone to paste in that much low-level boilerplate.
We talked about this in today's meeting (https://meetbot-raw.fedoraproject.org/fedora-meeting-1/2019-02-28/fpc.2019-02-28-17.01.txt):
to comment on this ticket.