[Debconf-devel] Bug#646252: Bug#646252: Please provide a way to check if debconf is running interactive or noninteractive frontend

Joey Hess joeyh at debian.org
Sat Oct 22 19:56:18 UTC 2011


Robert Luberda wrote:
> It would be nice if it would be possible to check from maintainer
> scripts if debconf is running interactively or not. I would use such a
> feature to fix #645240 (run some command in background for interactive
> use or spawn it in foreground/don't run at all for noninteractive).
> 
> I tried using the 'seen' flag, but I found it unreliable due to
> DEBCONF_NONINTERACTIVE_SEEN.

I think one way to accomplish what you want to do is to have the value
be true in the template, and then:

if ! db_input foo/bar; then
	not_seen=1
fi
db_go
db_get foo/bar
if [ "$not_seen" ] || [ "$RET" = false ]; then
	foreground=1
fi

It does prevent preseeding of the question, but preseeding may not
matter.

> I've also found debconf's VISIBLE command, but it is not documented, and
> seems to always return 'true' regardless of the frontend.

It's deprecated and does nothing but check the seen flag.

-- 
see shy jo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/debconf-devel/attachments/20111022/2d8c713b/attachment.pgp>


More information about the Debconf-devel mailing list