[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#375689: Instructions on how to reconfigure xserver-xorg are incorrect



On Fri, Jul 14, 2006 at 05:03:31AM +0100, James Westby wrote:
> I have a workaround for the problem, I will send it now while I
> remember. I will try and figure out a fix tomorrow.
> 
> change 
> 
> # here's a novel concept: DON'T TOUCH THE CONFIG ON UPGRADES
> if [ -z "$UPGRADE" ] || dpkg --compare-versions "$2" le "1:7.0.14"; then
> 
> to 
> 
> # here's a novel concept: DON'T TOUCH THE CONFIG ON UPGRADES
> if [ -z "$UPGRADE" ] || dpkg --compare-versions "$2" le "1:8.0.14"; then
> 
> in /var/lib/dpkg/info/xserver-xorg.postinst

I think the reason for the trouble is that the code in
xserver-xorg.postinst that decides whether to set UPGRADE is broken. It
does this:

if [ "$1" = "configure" ] && [ -n "$2" ]; then
  UPGRADE='true'
fi

However, dpkg-reconfigure calls the postinst with "configure
<current-version>", so this wrongly thinks that reconfigure == upgrade.

The Ubuntu xorg package has this in xsfbs.sh, which works better (and is
forward-compatible to some future time when the DEBCONF_RECONFIGURE
business is dropped from debconf and replaced with a proper reconfigure
argument):

if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
  RECONFIGURE="true"
else
  RECONFIGURE=
fi

if ([ "$1" = "install" ] || [ "$1" = "configure" ]) && [ -z "$2" ]; then
  FIRSTINST="yes"
fi

if [ -z "$RECONFIGURE" ] && [ -z "$FIRSTINST" ]; then
  UPGRADE="yes"
fi

Cheers,

-- 
Colin Watson                                       [cjwatson@debian.org]



Reply to: