Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Packaging : cleaning postinst + debconf

User discussion about Debian Development, Debian Project News and Announcements. Not for support questions.
Post Reply
Message
Author
dlenci
Posts: 1
Joined: 2013-02-21 16:03

Packaging : cleaning postinst + debconf

#1 Post by dlenci »

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

Post Reply