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

Using debconf to choose among related packages.



The Debconf programmers tutorial have a section about choosing among
related packages. The only thing it doesn't show is how to act on what
the user choose. When we're only installing packages thing seem
straight away. The choosen package can manage it.

But how about when the user tries to remove the choosen package. How
does the new package configure itself to be the one which is used?

The Programmers Tutorial uses this code in postrm:


 if [ -e /usr/share/debconf/confmodule ]; then
     . /usr/share/debconf/confmodule
     # I no longer claim this question.
     db_unregister shared/window-manager

     # See if the shared question still exists.
     if db_get shared/window-manager; then
         db_metaget shared/window-manager owners
         db_subst shared/window-manager choices $RET
         db_metaget shared/window-manager value
         if [ "<package>" = "$RET" ] ; then
             db_fset shared/window-manage seen false
             db_input critical shared/window-manager || true
             db_go || true
         fi
     fi
 fi


But this doesn't configure the new choice. I guess something like the
following could be done (Well probally instead of the last db_input
and db_go):

  db_metaget shared/window-manager owners
  for PKG in $RET; do
    dpkg-reconfigure -u $PKG;
  done

It is the way to go? Could it break anything? Have I overlooked
something obvious?

-- 
Peter



Reply to: