[Distutils] Persistent system-level files across installations

Floris Bruynooghe flub at devork.be
Tue Oct 4 14:55:18 CEST 2011


Hi Mac

On 4 October 2011 08:51, Mac Ryan <quasipedia at gmail.com> wrote:
> What I am trying to achieve is to have certain files of my application
> that are persistent across software updates in other words: updating
> from mypackage-1.0 to mypackage-1.0.1 should imply overwriting only
> certain files of the v.1.0 if present, but not all of them. These
> "persistent files" are application-specific and not user-specific (i.e.
> they don't live in the /home/* hierarchy).
>
> [If this information is of any use: said files are sqlite files with
> usage statistic]

Since you're targeting Debian the FHS [0] applies and these files
should go into /var.

> At what level should I manage this? It is something I have to manage
> within my application (1), within my setup.py configuration script (2),
> or is something I am obliged to handle by dropping stdeb and packaging
> for debian "from scratch" (3)?

You will have to do this in your application yourself: don't let a
file be installed but create them at runtime.  If you're following
Debian policy (which you should) you should remove the created files
in the postrm script of the Debian package when the package is being
purged (but not when removed).  The Debian policy [1] explains all
these rules.  As I've never used stdeb I don't know if that provides
you with the required functionality however.


Regards,
Floris


[0] http://www.pathname.com/fhs/
[1] http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html


-- 
Debian GNU/Linux -- The Power of Freedom
www.debian.org | www.gnu.org | www.kernel.org


More information about the Distutils-SIG mailing list