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

Re: Info about dtxtdb



On Tue, Dec 16, 1997 at 08:05:15AM -0500, Richard G. Roberto wrote:
> On Mon, 15 Dec 1997, David Frey wrote:
> 
> > Sure, you're right. This is really a good idea. The next step beyond
> > dtxtdb would be a set of utilities (debask for the console, a tool
> > for X11, ...) which would present these messages to the user.
> > 
> > We had a discussion some time about this. What was the consesus?
> > 
> > David
> 
> I think there was none.  We got side tracked on the config
> file parser thing and then we all fizzled out.  Basically, a
> package's pre/post scripts should be able to check to see if
> there is a source setting for configuration data (such as a
> database name) and use that to get and put its settings it
> would otherwise prompt the user for.  

[snip long commentary]

The issue which most urgently needs dealing with is that of postinst (etc.)
scripts asking questions about the package. There is no standard way
of doing it. Most people are using echo, read, and shell scripts. This
precludes a nice X-based configuration interface.

The first step (before implementing anything looking even remotely like
database support) is to get a "debask" tool working. We need to specify
an interface, and get it working. There are two ways of doing such a
thing. In my opinion, postinst should not directly ask any questions at all.
This prevents any later reconfiguration of the package through the same
method. The standard seems to be a script /usr/sbin/blahconfig.
This "blahconfig" script could look something like the following, very simple,
example:-

#!/bin/bash
export PATH=/usr/local/sbin:/sbin:/usr/sbin:/usr/local/bin:/bin:/usr/bin
OPTIONS=""
INIT=0
while getopts :i ARG;
do
	if [ "$ARG" = "i" ]; then
		OPTIONS="$OPTIONS --no-auto-answer"
		INIT=1
	fi
done
if [ $INIT = 0 ]; then
	if debask --dialog --yesno "Do you want to configure <blah> now?"; then
		exit 0
	fi
fi
OPTIND=1
eval `debask --bash --script-mode $OPTIONS <<SCRIPT_EOF
title "<Blah> package configuration"
yesno BLAH_ENABLEREMOTE "Enable remote access facilities?"
if BLAH_ENABLEREMOTE
	yesno BLAH_REMOTE_ANON "Enable anonymous access?"
SCRIPT_EOF`
if [ "$BLAH_ENABLEREMOTE" = "y" ]; then
	#abc
	if [ "$BLAH_REMOTE_ANON" = "y" ]; then
		#xyz
		;
	fi
fi
## End of script

As you can see, the issue of name space may come up already (BLAH_...).
However, other issues can, at this point, be avoided. I have written a
simple debask tool (and attached the sources). Its not very clean,
but it works with the above script, and it is easily extensible to
X.

Thanks.

Attachment: debask.tar.gz
Description: GNU Zip compressed data


Reply to: