Persistent system-level files across installations
I am using stdeb to produce my debian packages and I am a novice when it comes to packaging in general, so bear with me if I am mixing together apples and oranges and just help me understanding better... 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] My questions: 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)? Any link to examples very much appreciated! Thank you in advance for your time! :) /mac
Hi Mac
On 4 October 2011 08:51, Mac Ryan
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
On Oct 04, 2011, at 01:55 PM, Floris Bruynooghe wrote:
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.
No, I don't believe it does, though it's been a while since I used stdeb. Not that it provides any more help for Mac's original question, but these days I tend to use pkgme for the initial debian layout (if I don't just cargo cult it from a working package that is ;). https://launchpad.net/pkgme Cheers, -Barry
On Wed, 5 Oct 2011 16:50:49 -0400
Barry Warsaw
No, I don't believe it does, though it's been a while since I used stdeb. Not that it provides any more help for Mac's original question, but these days I tend to use pkgme for the initial debian layout (if I don't just cargo cult it from a working package that is ;).
I heard about it before but I never tried it myself. I will have a look at it then. Thanks for the tip! /mac
participants (3)
-
Barry Warsaw
-
Floris Bruynooghe
-
Mac Ryan