[Dev] Install media releng / I made some changes
Luke Shumaker
lukeshu at lukeshu.com
Tue Nov 7 17:58:32 GMT 2017
On Tue, 07 Nov 2017 06:10:02 -0500,
fauno wrote:
> > - I think it would be really cool if any files not owned by a package
> > or modified from the vanilla version on the install media were
> > managed by [holo][].
>
> what i always wondered about shipping conf files as pacman packages is
> how will they be treated since they belong to another package. for
> instance if you ship pacman.conf and then install the holo package,
> won't you get it as pacman.conf.pacnew?
I've never liked how the Holo docs explain this (translation: I've
been meaning to file a PR against the Holo docs. So let's have a stab
at it!).
Let's draw a distinction between big-picture the "Holo" system
(capitol-H), and the specific "holo" package/program (lowercase-h).
Holo is a configuration management system that isn't. Conf files are
just files owned by package-manager packages. This works out
splendidly when the default .conf file does something like "include
/etc/pkgname.d/*.conf" and Holo configuration packages ("holograms")
can just drop new files in "pkgname.d". Nowhere in that description
did we describe a new piece of software to call Holo, we just
described normal operating system packages! You can successfully use
Holo without using holo.
But there is of course the problem that sometimes a hologram needs to
edit a file that is owned by another package; for example
/etc/collectd.conf can't be owned by both "collectd" and by
"hologram-my-collectd-config". This is where the "holo"
package/program comes in. "holo" hooks in to the package manager's
hooks system (yay pacman 5), to be able to patch files as they are
installed by the package manager.
So, to take the collectd.conf example,
"hologram-my-collectd-config" is a normal package that depends
on "collectd" (whose config files it will be editing), and "holo"
(since it will be needing to edit files owned by another package), and
providing a file under /usr/share/holo/ that will specify how
collectd.conf is to be modified.
- Installing/updating the hologram: "hologram-my-collectd-config"
will have post_install, post_update, and post_remove scripts that
all call `holo apply etc/collectd.conf`, which will use the file
under /usr/share/holo/ to modify collectd.conf.
- Updating the base package: When collectd updates their default
configuration file, pacman will try to install it, but see that
/etc/collectd.conf was modified (by holo), and install it as
collectd.conf.pacnew; but then it will run
/usr/share/libalpm/hooks/01-holo-resolve-pacnew.hook, which will
end up calling `holo apply etc/collectd.conf` which will use the
file under /usr/share/holo/ to modify the .pacnew file (just as it
did the original collectd.conf), and install that as the new
collectd.conf.
As long as nothing else modifies the file other than "holo" (`holo
apply` keeps track of how it left the file, and can detect if it has
been changed), it should always be able to merge the .pacnew file
without conflict.
--
Happy hacking,
~ Luke Shumaker
More information about the Dev
mailing list