public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] RFC: Package Manager Specification: configuration protection
@ 2006-09-11 22:22 Ciaran McCreesh
  2006-09-11 23:02 ` Chris White
                   ` (5 more replies)
  0 siblings, 6 replies; 26+ messages in thread
From: Ciaran McCreesh @ 2006-09-11 22:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: paludis-sekrit


[-- Attachment #1.1: Type: text/plain, Size: 854 bytes --]

A while back it was agreed that it would be a good idea to standardise
certain aspects of package manager behaviour. We thought it'd be a good
idea to start with something easy so that we can iron out any kinks in
the process... So...

Attached is a first draft of an attempt at standardising how
configuration protection is handled. Although it's not strictly
speaking a core part of the ebuild API, it's none the less something
that should probably be handled consistently.

Comments both on the nature and the specifics of the specification
would be welcomed. In particular, I'd like to know if people think
we're mandating the appropriate degree of specificity and whether we're
providing sufficient generality to avoid overly restricting innovation.

Yours lovingly,
-- 
Ciaran McCreesh
Mail            : ciaranm at ciaranm.org


[-- Attachment #1.2: PMS-Configuration-Protection.txt --]
[-- Type: text/plain, Size: 3694 bytes --]

==================================================
Package Manager Standard: Configuration Protection
==================================================

Abstract
========

This document defines how a Package Manager should handle the filesystem aspect
of configuration protection.

Overview
========

Configuration protection is used by a Package Manager to avoid overwriting or
removing important configuration files (e.g. ``/etc/fstab``) when updating or
uninstalling a package. Rather than overwriting these files in the merge phase,
the file to be installed is renamed according to a defined set of rules; when
unmerging a package, these files are not removed.

File Merging Rules
==================

When merging a file to a protected location:

* If no existing file with the intended target name exists, or if the existing
  file has identical content to the file to be installed, the file to be installed
  is installed as normal.

* Otherwise, pretend that the filename of the file to be installed is
  ``._cfg0000_name``, where ``name`` is the real name. If no file with this name
  exists, or if the existing file with this name has identical content to the file
  to be installed, the file to be installed is merged with this new name.

* Otherwise, try again with ``._cfg0001_name``, then ``._cfg0002_name`` and so
  on (base ten is used for the number part) until a usable filename is found.

* Behaviour is undefined in the highly unlikely circumstance that ``9999`` is
  reached.

Configuration protection does not apply to non-files.

File Unmerging Rules
====================

Files in a protected location should not be unmerged.

Protected Locations
===================

Protected locations are determined by the ``CONFIG_PROTECT`` environment
variable, which is defined in the profiles and which may be augmented or
overridden by the current environment and user configuration files. This
variable contains a space separated list of values which are matched against the
beginning of a full file path and name of files to be installed.

Any item inside ``CONFIG_PROTECT`` that starts with a minus symbol
instead removes any previous item with the value following the minus from the
list. The special value ``-*`` can be used to remove *all* previous values.

The behaviour of special wildcard characters inside items (e.g.
``/foo?bar/*monkey*/baz``) is undefined.

The ``CONFIG_PROTECT_MASK`` environment variable, which has the same format and
origin as ``CONFIG_PROTECT``, can be used to unprotect locations. If any of its
items match the beginning of the full file path and name of a file to be
installed, that file is *not* considered protected.

For example, if ``CONFIG_PROTECT`` is ``/etc /usr/share/X11/xkb`` and
``CONFIG_PROTECT_MASK`` is ``/etc/init.d``, files to be installed to these
locations are considered protected:

* ``/etc/fstab``
* ``/etc/vim/vimrc``
* ``/etcetera``
* ``/usr/share/X11/xkb/keycodes/ibm``

And these are considered not protected:

* ``/usr/share/foo/foo.txt``
* ``/etc/init.d/sshd``
* ``/etc/init.donkey``
* ``/usr/local/etc/fstab``

If ``ROOT`` is in use, configuration protection should be applied to the
``ROOT`` directory rather than the normal filesystem root. For example, if
``ROOT`` is ``/image`` and ``CONFIG_PROTECT`` is ``/etc``, then ``/image/etc``
should be protected.

Integration with External Tools
===============================

The package manager should provide a way for external tools to obtain a list of
locations where protected files requiring action may be found.

.. vim: set tw=80 ft=glep spell spelllang=en : ..

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2006-09-20 20:16 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-11 22:22 [gentoo-dev] RFC: Package Manager Specification: configuration protection Ciaran McCreesh
2006-09-11 23:02 ` Chris White
2006-09-11 23:15   ` Ciaran McCreesh
2006-09-16  7:21     ` Brian Harring
2006-09-12  1:13   ` Robin H. Johnson
2006-09-12  0:30 ` Michael Cummings
2006-09-13 20:05   ` Peter Volkov (pva)
2006-09-12  8:19 ` Simon Stelling
2006-09-12  9:31   ` Ciaran McCreesh
2006-09-12 17:36     ` Zac Medico
2006-09-12 22:44     ` Zac Medico
2006-09-12 22:51       ` Ciaran McCreesh
2006-09-12 23:57         ` Zac Medico
2006-09-20 20:11           ` Mike Frysinger
2006-09-13  1:00         ` Ilya A. Volynets-Evenbakh
2006-09-13 17:47 ` Benno Schulenberg
2006-09-13 20:42   ` Daniel Gryniewicz
2006-09-14 17:34     ` Benno Schulenberg
2006-09-14 19:30   ` Thomas de Grenier de Latour
2006-09-15 20:27     ` Benno Schulenberg
2006-09-14  6:51 ` Harald van Dijk
2006-09-15 18:39   ` Ciaran McCreesh
2006-09-16  6:56     ` Harald van Dijk
2006-09-16  7:17 ` Brian Harring
2006-09-16 22:02   ` Ciaran McCreesh
2006-09-17  0:26     ` Brian Harring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox