0

I am trying to make a debian package ask questions to users

I am using debuild to build the package

I have a config and a templates file in debian directory

config file:

#!/bin/sh 
# Exit on error
set -e
# Source debconf library.
. /usr/share/debconf/confmodule
# Ask questions
db_input medium packagename/question1 || true
# Show interface
db_go || true

templates file:

Template: packagename/question1
Type: boolean
Default: true
Description: Borro versiones anteriores de este paquete ubicadas 
Asi es

I put # Source debconf library. . /usr/share/debconf/confmodule # Fetching configuration from debconf db_get packagename/question1 ANSWER1=$RET

inside my postinst script

When I executes:

sudo debian/config 

there is no response at all, silent as a good, correct unix statement.

I know templates is ok because if I write sometihng wrong it complains. for example removing a space, produces: "Template parse error near `Asi es', in stanza #1 of debian/templates"

If I make debuild, I get a package and with dpkg-i, the package is installed, but without answers.

What can I do to get questions to the user?

1 Answers1

0

Ok, its solved.

I changed medium to critical in config file dh:input

sorry PD also in config file:

#!/bin/sh
# Exit on error
set -e 
# Source debconf library.
. /usr/share/debconf/confmodule
db_fset  PKG/question1 seen false    <<<<<<<< this is important also
db_set  PKG/question1  false 
db_subst PKG/question1 LISTA "$SALIDA"
db_input critical PKG/question1

# Show interface
db_go || true