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

Bug#226292: xdm: can't reconfigure default window manager



retitle 226292 xdm: config script doesn't set debconf choices to owners if choices is null
tag 226292 - moreinfo
thanks

On Sat, Jan 10, 2004 at 07:32:15PM +0000, Julian Gilbey wrote:
> On Fri, Jan 09, 2004 at 01:27:19PM -0500, Branden Robinson wrote:
> > On Wed, Jan 07, 2004 at 06:55:04AM +0000, Julian Gilbey wrote:
> > > On Tue, Jan 06, 2004 at 09:19:54PM -0500, Branden Robinson wrote:
> > > > Please show me (er, well, mail this bug) the output of the misbehaving
> > > > dpkg-reconfigure command after doing this:
> > > > 
> > > > # export DEBUG_XFREE86_PACKAGE=yes
> > > 
> > > Not so much info there, I'm afraid :-(
> > 
> > Grrr.
> > 
> > All right, show me *this*:
> > 
> > /usr/share/debconf/frontend sh -x /var/lib/dpkg/info/xdm.config reconfigure
> 
> Here it is:
[skipping to the good bits]
> + DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
> + OWNERS=
> + db_metaget shared/default-x-display-manager owners
> + echo METAGET shared/default-x-display-manager owners
> + local IFS=
> 
> + local _LINE
> + read -r _LINE
> + RET=kdm, xdm
> + return 0
> + OWNERS=kdm, xdm
> + CHOICES=
> + db_metaget shared/default-x-display-manager choices
> + echo METAGET shared/default-x-display-manager choices
> + local IFS=
> 
> + local _LINE
> + read -r _LINE
> + RET=
> + return 0
> + CHOICES=
> + [ -n kdm, xdm -a -n  ]
> + NEW_DEFAULT=
> + db_get shared/default-x-display-manager
> + echo GET shared/default-x-display-manager
> + local IFS=
> 
> + local _LINE
> + read -r _LINE
> + RET=
> + return 0
> + NEW_DEFAULT=
> + [ -n  ]
> + exit 0
> polya2:~ # 

Okay, let's try to understand this with reference to the actual shell
script.

     19 # set default display manager
     20 DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
     21
     22 OWNERS=
     23 if db_metaget shared/default-x-display-manager owners; then
     24   OWNERS="$RET"
     25 fi

Looks like this worked right.  $OWNERS got set to "kdm, xdm".

     26
     27 CHOICES=
     28 if db_metaget shared/default-x-display-manager choices; then
     29   CHOICES="$RET"
     30 fi

I'm not sure this worked as expected.  db_metaget exited with a 0 exit
status, but $CHOICES was set to "".

     32 if [ -n "$OWNERS" -a -n "$CHOICES" ]; then

$OWNERS is non-null but $CHOICES is not.  Therefore the body of this
block is skipped.

Hmm, the body of this loop should probably be entered if $OWNERS is
non-null.  In fact I don't reference $CHOICES within it, so I was
probably being overly cautious.  I see this happened in revision 506.

Okay, I think I have found the bug.  I will fix this and look for
similar bad logic in the other maintainer scripts.

Thanks for your report.

-- 
G. Branden Robinson                |    You can have my PGP passphrase when
Debian GNU/Linux                   |    you pry it from my cold, dead
branden@debian.org                 |    brain.
http://people.debian.org/~branden/ |    -- Adam Thornton

Attachment: signature.asc
Description: Digital signature


Reply to: