Bug 183082 - gdm package scripts could use some attention
Summary: gdm package scripts could use some attention
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gdm
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ray Strode [halfline]
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-02-26 01:58 UTC by Michal Jaegermann
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-02-26 14:53:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
a variant of %post script for 'gdm' package (2.43 KB, text/plain)
2006-02-26 01:58 UTC, Michal Jaegermann
no flags Details

Description Michal Jaegermann 2006-02-26 01:58:35 UTC
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

Comment 1 Michal Jaegermann 2006-02-26 01:58:35 UTC
Created attachment 125265 [details]
a variant of %post script for 'gdm' package

Comment 2 Ray Strode [halfline] 2006-02-26 14:53:11 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.