{
    "content": [
        {
            "type": "text",
            "text": "# UCFR (man)\n\n**Summary:** ucfr - Update Configuration File Registry:  associate packages with configuration files\n\n**Synopsis:** ucfr [options] <Package> <Path to configuration file>\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -h | --help | — | Print a short usage message |\n| -n | --no-action | — | Dry run. Print the actions that would be taken if the script is invoked, but take no action. |\n| -d | --debug | [n] | Set the debug level to the (optional) level n (n defaults to 1). This turns on copious debugging information. |\n| -p | --purge | — | Removes all vestiges of the association between the named package and the configura‐ tion file from the registry. The as |\n| -v | --verbose | — | Make the script be very verbose about setting internal variables. |\n| -f | --force | — | This option forces operations requested even if the configuration file in considera‐ tion is owned by another package. T |\n| — | --state-dir | — | Set the state directory to /path/to/dir instead of the default /var/lib/ucf. Used mostly for testing. |\n\n## Examples\n\n- `If  the package foo wants to use ucfr to associate itself with a configuration file foo.conf,`\n- `a simple invocation of ucfr in the postinst file is all that is needed:`\n- `ucfr foo /etc/foo.conf`\n- `On purge,  one  should  tell  ucf  to  forget  about  the  file  (see  detailed  examples  in`\n- `/usr/share/doc/ucf/examples):`\n- `ucfr --purge foo /etc/foo.conf`\n- `If  you want to remove all the conf files for a given package foo, the simplest way is to use`\n- `ucfq.  For example`\n- `ucfq -w foo | cut -d : -f 1 | while read cfile ; do ucfr -v $cfile ; done`\n\n## See Also\n\n- ucf(1)\n- ucf.conf(5)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (13 lines)\n- **OPTIONS** (1 lines) — 7 subsections\n  - -h, --help (2 lines)\n  - -n, --no-action (3 lines)\n  - -d [n], --debug [n] (3 lines)\n  - -p, --purge (9 lines)\n  - -v, --verbose (2 lines)\n  - -f, --force (5 lines)\n  - --state-dir /path/to/dir (3 lines)\n- **USAGE** (5 lines)\n- **FILES** (5 lines)\n- **EXAMPLES** (15 lines)\n- **SEE ALSO** (2 lines)\n- **AUTHOR** (6 lines)\n\n## Full Content\n\n### NAME\n\nucfr - Update Configuration File Registry:  associate packages with configuration files\n\n### SYNOPSIS\n\nucfr [options] <Package> <Path to configuration file>\n\n### DESCRIPTION\n\nWhere  Package is the package associated with the configuration file (and, in some sense, its\nowner), and Path to configuration file is the full path to the location (usually under  /etc)\nwhere  the configuration file lives, and is potentially modified by the end user. Please note\nthat usually this means that we register actual files, and not symbolic links to files.  ucfr\nwill follow symbolic links and register the real file,  and not the symbolic link.\n\nThis  script  maintains an association between configuration files and packages, and is meant\nto help provide facilities that dpkg provides  conffiles  for  configuration  files  and  not\nshipped in a Debian package, but handled by the postinst by ucf instead. This script is idem‐\npotent, associating a package to a file multiple times is not an error.  It  is  normally  an\nerror  to  try to associate a file which is already associated with another package, but this\ncan be overridden by using the --force option.\n\n### OPTIONS\n\n#### -h, --help\n\nPrint a short usage message\n\n#### -n, --no-action\n\nDry run. Print the actions that would be taken if the script is invoked, but  take  no\naction.\n\n#### -d [n], --debug [n]\n\nSet the debug level to the (optional) level n (n defaults to 1). This turns on copious\ndebugging information.\n\n#### -p, --purge\n\nRemoves all vestiges of the association between the named package and  the  configura‐\ntion  file from the registry. The association must already exist; if the configuration\nfile is associated with some other  package,  an  error  happens,  unless  the  option\n--force  is  also given. In that case, the any associations for the configuration file\nare removed from the registry, whether or not the package name matches. This action is\nidempotent,  asking  for an association to be purged multiple times does not result in\nan error, since attempting to remove an non-existent association is  silently  ignored\nunless the --verbose option is used (in which case it just issues a diagnostic).\n\n#### -v, --verbose\n\nMake the script be very verbose about setting internal variables.\n\n#### -f, --force\n\nThis  option  forces operations requested even if the configuration file in considera‐\ntion is owned by another package. This allows a package to hijack a configuration file\nfrom  another  package,  or  to  purge the association between the file and some other\npackage in the registry.\n\n#### --state-dir /path/to/dir\n\nSet the state directory to /path/to/dir instead of  the  default  /var/lib/ucf.   Used\nmostly for testing.\n\n### USAGE\n\nThe most common case usage is pretty simple: a single line invocation in the postinst on con‐\nfigure, and another single line in the postrm to tell ucfr to forget  about  the  association\nwith  the  configuration file on purge (using the  --purge option) is all that is needed (as‐\nsuming ucfr is still on the system).\n\n### FILES\n\n/var/lib/ucf/registry, and /var/lib/ucf/registry.X, where X is a small integer, where  previ‐\nous versions of the registry are stored.\n\n/etc/ucf.conf\n\n### EXAMPLES\n\nIf  the package foo wants to use ucfr to associate itself with a configuration file foo.conf,\na simple invocation of ucfr in the postinst file is all that is needed:\n\nucfr foo /etc/foo.conf\n\nOn purge,  one  should  tell  ucf  to  forget  about  the  file  (see  detailed  examples  in\n/usr/share/doc/ucf/examples):\n\nucfr --purge foo /etc/foo.conf\n\nIf  you want to remove all the conf files for a given package foo, the simplest way is to use\nucfq.  For example\n\nucfq -w foo | cut -d : -f 1 | while read cfile ; do ucfr -v $cfile ; done\n\n### SEE ALSO\n\nucf(1), ucf.conf(5).\n\n### AUTHOR\n\nThis manual page was written Manoj Srivastava <srivasta@debian.org>, for the Debian GNU/Linux\nsystem.\n\n\n\nDebian                                       Feb 16 2018                                     UCFR(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "UCFR",
        "section": "",
        "mode": "man",
        "summary": "ucfr - Update Configuration File Registry:  associate packages with configuration files",
        "synopsis": "ucfr [options] <Package> <Path to configuration file>",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "Print a short usage message"
            },
            {
                "flag": "-n",
                "long": "--no-action",
                "arg": null,
                "description": "Dry run. Print the actions that would be taken if the script is invoked, but take no action."
            },
            {
                "flag": "-d",
                "long": "--debug",
                "arg": "[n]",
                "description": "Set the debug level to the (optional) level n (n defaults to 1). This turns on copious debugging information."
            },
            {
                "flag": "-p",
                "long": "--purge",
                "arg": null,
                "description": "Removes all vestiges of the association between the named package and the configura‐ tion 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 --force 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 --verbose option is used (in which case it just issues a diagnostic)."
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "Make the script be very verbose about setting internal variables."
            },
            {
                "flag": "-f",
                "long": "--force",
                "arg": null,
                "description": "This option forces operations requested even if the configuration file in considera‐ tion is owned by another package. This allows a package to hijack a configuration file from another package, or to purge the association between the file and some other package in the registry."
            },
            {
                "flag": "",
                "long": "--state-dir",
                "arg": null,
                "description": "Set the state directory to /path/to/dir instead of the default /var/lib/ucf. Used mostly for testing."
            }
        ],
        "examples": [
            "If  the package foo wants to use ucfr to associate itself with a configuration file foo.conf,",
            "a simple invocation of ucfr in the postinst file is all that is needed:",
            "ucfr foo /etc/foo.conf",
            "On purge,  one  should  tell  ucf  to  forget  about  the  file  (see  detailed  examples  in",
            "/usr/share/doc/ucf/examples):",
            "ucfr --purge foo /etc/foo.conf",
            "If  you want to remove all the conf files for a given package foo, the simplest way is to use",
            "ucfq.  For example",
            "ucfq -w foo | cut -d : -f 1 | while read cfile ; do ucfr -v $cfile ; done"
        ],
        "see_also": [
            {
                "name": "ucf",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ucf/1/json"
            },
            {
                "name": "ucf.conf",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/ucf.conf/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-h, --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-n, --no-action",
                        "lines": 3,
                        "flag": "-n",
                        "long": "--no-action"
                    },
                    {
                        "name": "-d [n], --debug [n]",
                        "lines": 3,
                        "flag": "-d",
                        "long": "--debug",
                        "arg": "[n]"
                    },
                    {
                        "name": "-p, --purge",
                        "lines": 9,
                        "flag": "-p",
                        "long": "--purge"
                    },
                    {
                        "name": "-v, --verbose",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-f, --force",
                        "lines": 5,
                        "flag": "-f",
                        "long": "--force"
                    },
                    {
                        "name": "--state-dir /path/to/dir",
                        "lines": 3,
                        "long": "--state-dir"
                    }
                ]
            },
            {
                "name": "USAGE",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "ucfr - Update Configuration File Registry:  associate packages with configuration files\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "ucfr [options] <Package> <Path to configuration file>\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Where  Package is the package associated with the configuration file (and, in some sense, its\nowner), and Path to configuration file is the full path to the location (usually under  /etc)\nwhere  the configuration file lives, and is potentially modified by the end user. Please note\nthat usually this means that we register actual files, and not symbolic links to files.  ucfr\nwill follow symbolic links and register the real file,  and not the symbolic link.\n\nThis  script  maintains an association between configuration files and packages, and is meant\nto help provide facilities that dpkg provides  conffiles  for  configuration  files  and  not\nshipped in a Debian package, but handled by the postinst by ucf instead. This script is idem‐\npotent, associating a package to a file multiple times is not an error.  It  is  normally  an\nerror  to  try to associate a file which is already associated with another package, but this\ncan be overridden by using the --force option.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-h, --help",
                        "content": "Print a short usage message\n",
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-n, --no-action",
                        "content": "Dry run. Print the actions that would be taken if the script is invoked, but  take  no\naction.\n",
                        "flag": "-n",
                        "long": "--no-action"
                    },
                    {
                        "name": "-d [n], --debug [n]",
                        "content": "Set the debug level to the (optional) level n (n defaults to 1). This turns on copious\ndebugging information.\n",
                        "flag": "-d",
                        "long": "--debug",
                        "arg": "[n]"
                    },
                    {
                        "name": "-p, --purge",
                        "content": "Removes all vestiges of the association between the named package and  the  configura‐\ntion  file from the registry. The association must already exist; if the configuration\nfile is associated with some other  package,  an  error  happens,  unless  the  option\n--force  is  also given. In that case, the any associations for the configuration file\nare removed from the registry, whether or not the package name matches. This action is\nidempotent,  asking  for an association to be purged multiple times does not result in\nan error, since attempting to remove an non-existent association is  silently  ignored\nunless the --verbose option is used (in which case it just issues a diagnostic).\n",
                        "flag": "-p",
                        "long": "--purge"
                    },
                    {
                        "name": "-v, --verbose",
                        "content": "Make the script be very verbose about setting internal variables.\n",
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-f, --force",
                        "content": "This  option  forces operations requested even if the configuration file in considera‐\ntion is owned by another package. This allows a package to hijack a configuration file\nfrom  another  package,  or  to  purge the association between the file and some other\npackage in the registry.\n",
                        "flag": "-f",
                        "long": "--force"
                    },
                    {
                        "name": "--state-dir /path/to/dir",
                        "content": "Set the state directory to /path/to/dir instead of  the  default  /var/lib/ucf.   Used\nmostly for testing.\n",
                        "long": "--state-dir"
                    }
                ]
            },
            "USAGE": {
                "content": "The most common case usage is pretty simple: a single line invocation in the postinst on con‐\nfigure, and another single line in the postrm to tell ucfr to forget  about  the  association\nwith  the  configuration file on purge (using the  --purge option) is all that is needed (as‐\nsuming ucfr is still on the system).\n",
                "subsections": []
            },
            "FILES": {
                "content": "/var/lib/ucf/registry, and /var/lib/ucf/registry.X, where X is a small integer, where  previ‐\nous versions of the registry are stored.\n\n/etc/ucf.conf\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "If  the package foo wants to use ucfr to associate itself with a configuration file foo.conf,\na simple invocation of ucfr in the postinst file is all that is needed:\n\nucfr foo /etc/foo.conf\n\nOn purge,  one  should  tell  ucf  to  forget  about  the  file  (see  detailed  examples  in\n/usr/share/doc/ucf/examples):\n\nucfr --purge foo /etc/foo.conf\n\nIf  you want to remove all the conf files for a given package foo, the simplest way is to use\nucfq.  For example\n\nucfq -w foo | cut -d : -f 1 | while read cfile ; do ucfr -v $cfile ; done\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "ucf(1), ucf.conf(5).\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "This manual page was written Manoj Srivastava <srivasta@debian.org>, for the Debian GNU/Linux\nsystem.\n\n\n\nDebian                                       Feb 16 2018                                     UCFR(1)",
                "subsections": []
            }
        }
    }
}