Packaging : cleaning postinst + debconf

News and discussion about development of the Debian OS itself

Packaging : cleaning postinst + debconf

Postby dlenci » 2013-02-22 08:39

Hello !

I'm currently working on a package which uses debconf, and creates a bunch of files in the postinst script depending on the debconf answers.
I want to clean all the created files in the prerm script, and i wonder what is the best way to it properly.

- Reproduce my postinst algorithmic in prerm, but remove files instead of creating them ? :?
- Use regular expression to match my created files? (won't work in my package)
- Store created files name in a file?

What are the Debian best practices to do this?

I tried another solution using debconf :
1- create a new template string
2- set its value to the list of created files in postinst
3- get the list in prerm and remove them

It worked fine until i wanted to incrementally set the template value to avoid having files not removed if my postinst crashes. To do so, I obviously need to put my debconf 'set' call in a subroutine (I'm using Perl for my scripts). But when I do so, install blocks even if the subroutine is called only once :shock:
I can't understand how a call from a subroutine can differ from the same one outside any subroutine...
Is this a known behaviour, is there a workaround, or using debconf is just not I want anyway?

Thanks in advance

Damien Lenci
dlenci
 
Posts: 1
Joined: 2013-02-21 16:03

Return to Debian Development

Who is online

Users browsing this forum: No registered users and 1 guest

fashionable