Description of problem: Installation scripts in 'gdm' package should be more robust. The first problem is that if want to be sure that /etc/gdm/Xsession is replaced by a link from a package then we have to be sure that a file (link) with such name is absent or cpio unpacking may leave that alone. Something like that in %pre should be good enough in practice xsess=/etc/gdm/Xsession [ -f $xsess -a ! -h $xsess ] && mv $xsess ${xsess}.rpmsave possibly with the whole second line replaced simply by 'rm -f $xsess' (or 'rm' used in place of 'mv' if we want to be more careful). Proposed %post script is attached. Changes are reducing a number and complexity of edit operations (down to zero in a "normal" case). The whole logic is copied from an existing script but there is some doubt about an intent. Do we really seriously want to comment out from an old configuration file only a very specific "RebootCommand", with any changes in spacing or ordering giving "no match", or really a corresponding sed action should read closer to that: -e '/^RebootCommand=/s@^@### @' \ and similar in all cases where substitutions are done with "@#&@"? Version-Release number of selected component (if applicable): gdm-2.13.0.8-5
Created attachment 125265 [details] a variant of %post script for 'gdm' package
Hi, The idea of the sed scripts is to prune out unchanged defaults from the custom config, so that if the defaults are every changed in the defaults.conf file, then users will get the updated defaults. In the cases where a user explicitly edits the config file, the scripts probably shouldn't try to comment out the users change. That's the logic behind using exact strings anyway. I don't know if it's the best logic. In hindsight, I probably shouldn't have tried to migrate settings from gdm.conf to custom.conf at all. It only takes a minute to re setup the settings, it's something gdm users have been used to for a long time anyway, and it would have been a one time thing. Anyway, your %post scriplet looks good. I committed it. I probably won't build it until we need to make another change to gdm.