Hi guys, Attached a proof-of-concept for the advanced use case (in which the user actually wants to review which buggy packages to pin or upgrade). Consider this as a basis for further discussion, rather than something anywhere near a working patch.
To give it a try, save the attached files in the same directory (doesn't matter where), make apt-listbugs executable and run it as root (debconf needs to write /var/cache/debconf/{config,templates}.dat). The template file declares the contents of the debconf screen, whereby the multi-choice options are populated by the shell script via the $packages variable. The script overrides the "seen" debconf flag so that the question is asked every single time (to override the default debconf behaviour; feels like a hack). Going forward from here, one possibility would be for the apt-listbugs ruby script to invoke the debconf script (passing on the package/bug num/bug title info and getting back the user reply, via a tempfile or something along those lines). One issue with the debconf approach is that you can't fire up a browser to lookup a bug report before making the pin/upgrade decision (something that's possible with the current non-debconf based interaction). You also can't ^Z the debconf screen to do so manually. Any ideas about working around this? Another issue that should be straightforward: use debconf in postinst to ask the user to choose between newbie and advance use (ie. whether one should go through the above dialog on every invocation, or let apt-listbugs upgrade only non-rc-buggy packages without asking) -- defaulting to newbie mode? cheers, sez -- Every great idea is worthless without someone to do the work. --Neil Williams
#!/bin/sh set -e export DEBCONF_DEBUG=developer # debconf fails when DEBCONF_PACKAGE is set, but without it the # template entry in /var/cache/dpkg/config.dat has an unkown Owner, # which means that we can't remove it when apt-listbugs is purged. #export DEBCONF_PACKAGE="apt-listbugs" # other values: text, dialog, kde, web (the two latter hang for me) #export DEBIAN_FRONTEND=gnome # source debconf libary. . /usr/share/debconf/confmodule # to be constructed on the fly, based on apt & bts input PACKAGES="package0 #abcdef (short description), package1 #abcdef (short description)" # ask debconf to *always* show this question. without this, the # question will be shown only the first time, even for different # value sof $PACKAGES db_fset apt-listbugs/select-packages seen false # populate the template question with the list of RC-buggy packages # and associated bug numbers db_subst apt-listbugs/select-packages packages "$PACKAGES" # priority has to be high-enough, otherwise priority overrides the "seen: false" false db_input critical apt-listbugs/select-packages || true db_go || true db_get apt-listbugs/select-packages || true PACKAGES_TO_UPGRADE="$RET" # Close all fd's db_stop exit 0
Template: apt-listbugs/select-packages Type: multiselect Choices: ${packages} Description: Select packages to upgrade, at your own risk: The packages below will be pinned to the currently installed version, because their latest version is known to have a serious bug. . If you know what you are doing, you can nevertheless upgrade certain packages by selecting them in the list below.