On Thu, Feb 27, 2003 at 03:48:38PM -0500, Daniel Burrows wrote:
> On Thu, Feb 27, 2003 at 06:51:02PM +0100, Michel D?nzer <daenzer@debian.org> was heard to say:
> > Even with dpkg-reconfigure -plow ?
>
> I would hope so, since low is my default priority. Anyway, I just
> checked, and it skips that question even if I explicitly specify "low".
[...]
> My, that's messed up..anyway, maybe I should have used the example
> where I tested [ -n $(cat /proc/fb) ] and it failed. How's this?
> torrent:~> cat /proc/fb
> torrent:~> od /proc/fb
> 0000000
> torrent:~> cat /proc/fb | wc -c
> 0
Well, let's have a look at the code, shall we? Shell scripts are not
rocket science.
# use fbcon kernel functions?
if [ -e /proc/fb ]; then
if [ -n "$(cat /proc/fb)" ]; then
auto_answer db_input high xserver-xfree86/config/device/use_fbdev "true"
fi
else
db_get xserver-xfree86/config/device/use_fbdev || debug_report_status "db_get xserver-xfree86/config/device/use_fbdev" "$?"
if [ "$RET" = "true" ]; then
debug_echo "xserver-xfree86/config/device/use_fbdev is \"true\" but /proc/fb does not exist; setting template to \"false\""
db_set xserver-xfree86/config/device/use_fbdev false
fi
fi
Before you jump all over that "auto_answer" thing, hold your horses:
auto_answer () {
# Syntax: auto_answer input_command priority template default_answer
#
# Used to auto-answer questions that don't have reasonable defaults. Some
# people insist on running the xserver-xfree86 config script with the
# non-interactive frontend. For this to work, the debconf database will need
# to be pre-loaded with answers to several questions. You have been
# warned...
if [ $# -ne 4 ]; then
echo "internal error: auto_answer() called with wrong number of arguments: $*" >&2
exit 1
fi
INPUT_COMMAND=$1
PRIORITY=$2
TEMPLATE=$3
DEFAULT_ANSWER=$4
set +e
debug_echo "auto_answer() \"$INPUT_COMMAND $PRIORITY $TEMPLATE\" with default \"$DEFAULT_ANSWER\""
# are we re-configuring?
if [ -n "$RECONFIGURE" ]; then
# yes, we are reconfiguring
db_get $TEMPLATE
debug_echo "auto_answer: (reconfiguring) preserving existing answer \"$RET\""
else
# not reconfiguring; has the question been seen before?
db_fget $TEMPLATE seen
if [ "$RET" = "true" ]; then
db_get $TEMPLATE
debug_echo "auto_answer: (not reconfiguring) preserving existing answer \"$RET\""
else
debug_echo "auto_answer: auto-answering with \"$DEFAULT_ANSWER\""
db_set $TEMPLATE "$DEFAULT_ANSWER"
fi
fi
$INPUT_COMMAND $PRIORITY $TEMPLATE
if [ $? -eq 30 ]; then
debug_echo "auto_answer: $TEMPLATE is not being asked"
else
debug_echo "auto_answer: asking $TEMPLATE"
fi
set -e
db_go
db_get $TEMPLATE
debug_echo "auto_answer: $TEMPLATE is \"$RET\"";
}
As you can see, this function *does* permit manual prompting.
If someone would review the code-flow of both of the above snippets I'd
appreciate it.
Oh, this does bring to mind that you can use the DEBUG_XFREE86_DEBCONF
variable to get the config script to tell you, in fairly exacting
detail, what it's doing. Maybe try this?:
# DEBUG_XFREE86_DEBCONF=yes DEBIAN_FRONTEND=readline dpkg-reconfigure \
xserver-xfree86
Please send this bug the output of the above command if you don't find
out that the problem is operator error.
--
G. Branden Robinson | To stay young requires unceasing
Debian GNU/Linux | cultivation of the ability to
branden@debian.org | unlearn old falsehoods.
http://people.debian.org/~branden/ | -- Robert Heinlein
Attachment:
pgpraEpkdi2Wd.pgp
Description: PGP signature