man-pages/man1/ucfr.1.html
2021-03-31 01:06:50 +01:00

245 lines
5.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of UCFR</TITLE>
</HEAD><BODY>
<H1>UCFR</H1>
Section: Debian GNU/Linux manual (1)<BR>Updated: Feb 16 2018<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
ucfr - Update Configuration File Registry: associate packages with configuration files
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>ucfr</B>
[<I>options</I>]
<I>&lt;Package&gt;</I>
<I>&lt;Path to configuration file&gt;</I>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
Where
<I>Package</I>
is the package associated with the configuration file (and, in some
sense, its owner), and
<I>Path to configuration file</I>
is the full path to the location (usually under /etc) where the
configuration file lives, and is potentially modified by the end
user. Please note that usually this means that we register actual
files, and not symbolic links to files.
<B>ucfr</B>
will follow symbolic links and register the real file, and not the
symbolic link.
<P>
This script maintains an association between configuration files and
packages, and is meant to help provide facilities that
<I>dpkg</I>
provides conffiles for configuration files and not shipped in a
<B>Debian</B>
package, but handled by the postinst by
<I>ucf</I>
instead. This script is idempotent, associating a package to a file
multiple times is not an error. It is normally an error to try to
associate a file which is already associated with another package, but
this can be overridden by using the
<I>--force</I>
option.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="1"><B>-h, --help</B>
<DD>
Print a short usage message
<DT id="2"><B>-n, --no-action</B>
<DD>
Dry run. Print the actions that would be taken if the script is
invoked, but take no action.
<DT id="3"><B>-d [n], --debug [n]</B>
<DD>
Set the debug level to the (optional) level
<I>n</I>
(n defaults to 1). This turns on copious debugging information.
<DT id="4"><B>-p, --purge</B>
<DD>
Removes all vestiges of the association between the named package and
the configuration file from the registry. The association must already
exist; if the configuration file is associated with some other
package, an error happens, unless the option
<I>--force</I>
is also given. In that case, the any associations for the
configuration file are removed from the registry, whether or not the
package name matches. This action is idempotent, asking for an
association to be purged multiple times does not result in an error,
since attempting to remove an non-existent association is silently
ignored unless the
<I>--verbose</I>
option is used (in which case it just issues a diagnostic).
<DT id="5"><B>-v, --verbose</B>
<DD>
Make the script be very verbose about setting internal variables.
<DT id="6"><B>-f, --force</B>
<DD>
This option forces operations requested even if the configuration file
in consideration is owned by another package. This allows a package to
<I>hijack</I>
a configuration file from another package, or to purge the
association between the file and some other package in the registry.
<DT id="7"><B>--state-dir /path/to/dir</B>
<DD>
Set the state directory to /path/to/dir instead of the default
<I>/var/lib/ucf.</I>
Used mostly for testing.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>USAGE</H2>
The most common case usage is pretty simple: a single line invocation
in the postinst on configure, and another single line in the postrm to
tell
<B>ucfr</B>
to forget about the association with the configuration file on purge
(using the --purge option) is all that is needed (assuming ucfr is
still on the system).
<A NAME="lbAG">&nbsp;</A>
<H2>FILES</H2>
<I>/var/lib/ucf/registry,</I>
and
<I>/var/lib/ucf/registry.X,</I>
where
<I>X</I>
is a small integer, where previous versions of the registry are
stored.
<P>
<I>/etc/ucf.conf</I>
<A NAME="lbAH">&nbsp;</A>
<H2>EXAMPLES</H2>
If the package
<I>foo</I>
wants to use ucfr to associate itself with a configuration file
<I>foo.conf,</I>
a simple invocation of ucfr in the postinst file is all that is
needed:
<P>
<B>ucfr</B>
<I>foo</I>
<I>/etc/foo.conf</I>
<P>
On purge, one should tell ucf to forget about the file (see detailed
examples in /usr/share/doc/ucf/examples):
<P>
<B>ucfr</B>
<I>--purge</I>
<I>foo</I>
<I>/etc/foo.conf</I>
<P>
If you want to remove all the conf files for a given package
<I>foo,</I>
the simplest way is to use
<B>ucfq.</B>
For example
<P>
<B>ucfq</B>
<I>-w</I>
<I>foo |</I>
<B>cut</B>
<I>-d : -f 1 |</I>
<B>while read</B>
<I>cfile ;</I>
<B>do</B>
<B>ucfr</B>
<I>-v $cfile ;</I>
<B>done</B>
<A NAME="lbAI">&nbsp;</A>
<H2>SEE ALSO</H2>
<A HREF="/cgi-bin/man/man2html?1+ucf">ucf</A>(1), <A HREF="/cgi-bin/man/man2html?5+ucf.conf">ucf.conf</A>(5).
<A NAME="lbAJ">&nbsp;</A>
<H2>AUTHOR</H2>
This manual page was written Manoj Srivastava &lt;<A HREF="mailto:srivasta@debian.org">srivasta@debian.org</A>&gt;,
for the Debian GNU/Linux system.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="8"><A HREF="#lbAB">NAME</A><DD>
<DT id="9"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="10"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="11"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="12"><A HREF="#lbAF">USAGE</A><DD>
<DT id="13"><A HREF="#lbAG">FILES</A><DD>
<DT id="14"><A HREF="#lbAH">EXAMPLES</A><DD>
<DT id="15"><A HREF="#lbAI">SEE ALSO</A><DD>
<DT id="16"><A HREF="#lbAJ">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:28 GMT, March 31, 2021
</BODY>
</HTML>