summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'config-protection.tex')
-rw-r--r--config-protection.tex26
1 files changed, 26 insertions, 0 deletions
diff --git a/config-protection.tex b/config-protection.tex
new file mode 100644
index 0000000..9e0957e
--- /dev/null
+++ b/config-protection.tex
@@ -0,0 +1,26 @@
+\chapter{Configuration File Protection}
+\label{config-protect}
+
+The package manager should provide a means to prevent user configuration files from being
+overwritten by any package updates. The profile variables \t{CONFIG\_PROTECT} and
+\t{CONFIG\_PROTECT\_MASK} (section \ref{profile-variables} control the directories for which this
+should be enforced.
+
+In order to ensure interoperability with configuration update tools, the following scheme should be
+used by all package managers when merging any (regular) file:
+
+\begin{enumerate}
+\item If the directory containing the file to be merged is not listed in \t{CONFIG\_PROTECT}, and is
+ not a subdirectory of any such directory, the file is merged normally.
+\item If the directory containing the file to be merged is listed in \t{CONFIG\_PROTECT\_MASK}, or
+ is a subdirectory of such a directory, the file is merged normally.
+\item If no existing file with the intended filename exists, or the existing file has identical
+ content to the one being merged, the file is installed normally.
+\item Otherwise, prepend the filename with \t{.\_cfg0000\_}. If no file with the new name exists,
+ then the file is merged with this name.
+\item Otherwise, increment the number portion (to form \t{.\_cfg0001\_<name>}) and repeat step 4.
+ Continue this process until a usable filename is found.
+\item If 9999 is reached in this way, behaviour is undefined.
+\end{enumerate}
+
+% vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en :