Re: Protect directory/file ?
Ondrej Balaz <firstname.lastname@example.org> writes:
> I'm sorry, my english is worse.
> exists any way to protect directories and files against apt/dpkg changes ?
> I'm using lot of modifications to make my Debian perfect for me (for example
> modified init scripts, udev rules or my own /etc/apache2 layout). This is big
> pain everytime when I update packages - all files meant as program parts (no
> configuration files) are overwritten and changes I've made are lost. Then
> I must move proper files from my backup to their directories.
Nothing in etc is a programm file. So they won't be overwritten.
> Now I'm looking for a better hack/workaround to protect my modifications. I
> wonder if is it possible to redirect package files extraction to another
> directory (for example to put .protect file to /etc containing line
> REDIRECT="/tmp/etc-apt" and then all attempts to write file in /etc or
> its subdirectories will be redirected to the /tmp/etc-apt/...)
> I found something similar in tool dpkg-divert, but its oriented to single files
> and maintaining long list of contents of all directories will be bigger pain
> than rewriting parts of hdd with my "overlay".
There is only dpkg-divert for non conffiles if you don't use
debs. What you should do is put all your modifications (non conffiles)
into a debian package and set appropriate "Replaces: foobar" entries
in the control file. That way dpkg will know you overwrite files from
package 'foobar' and keep your version even when foobar gets
updated. It will also warn you if you overwrite files from other not
listed packages (or they your files).
> Thank you,