alpm-conf 0.5

[alpm-conf test coverage]

alpm-conf is an ArchLinux tool to manage /etc configuration files using git. It is implemented as a Python package.

Overview

Packages installed by pacman whose etc files have been changed in the last pacman upgrade and that have been changed by the root user [1] in the /etc directory are tracked in the master branch of the git repository created by the alpm-conf create subcommand.

Using the same algorithm that is used by pacman to select files that are installed with a .pacnew extension [2], the update subcommand cherry-picks the changes (i.e. merges the changes) made to etc files by the pacman upgrade into the files on a temporary master-tmp branch [3] created by the subcommand as a descendant of the master branch. The merge subcommand merges the master-tmp branch into the master branch and copies those files to the /etc directory. This completes the transaction and the temporary branch is deleted.

alpm-conf also tracks the changes in files that are created in /etc by the root user such as netctl profiles for example. The files must be added first and commited to the master branch by the alpm-conf user in order to be tracked afterward by alpm-conf.

The diff subcommand is a standalone utility that uses a temporary alpm-conf repository to print [4] the differences between the etc files of installed pacman package archives and the corresponding files modified in the /etc directory. The command takes less than 2 seconds to complete on a plain laptop with 1212 installed packages.

Git commands allow to:

  • list the names of files created in /etc by the root user and tracked in the master branch

  • print [4] the changes made in the master-tmp branch before running the merge subcommand

  • print [4] the changes made by the last alpm-conf merge subcommand

  • print [4] the differences between the etc files of installed pacman package archives and the corresponding files modified in the /etc directory

Documentation

The documentation is hosted at Read the Docs:

To access the documentation as a pdf document one must click on the icon at the down-right corner of any page. It allows to switch between stable and latest versions and to select the corresponding pdf document.

Requirements

The ArchLinux packages that are required by alpm-conf are installed with the command:

# pacman -Sy git util-linux alpm-mtree python pyalpm python-zstandard

pyalpm and alpm-mtree are used to access the ArchLinux local database, util-linux provides setpriv allowing to run alpm-conf as root while running git commands as the creator of the git repository.

Installation

Install the python-alpm-conf package from the AUR.

Or install alpm-conf with pip:

$ python -m pip install alpm-conf

Footnotes