โ - โ
HOWTO: Set up etckeeper on Void Linux
etckeeper keeps track of all the changes you make to your /etc directory over time. It keeps a .git repo inside of /etc, and will do a git commit:
* before and after installing or removing a void package
* once a day (with cron)
Since Void Linux will serve the package in its original form and won't configure it for you, here's the steps you need to follow to make it do the above:
1. Install the etckeeper package
2. Create or edit an /etc/.gitignore file to include files you don't want to be versioned (such as resolv.conf)
3. As use root run: etckeeper init, and then: etckeeper commit "first commit"
4. Create a symbolic link from /etc/cron.daily/etckeeper to /etc/etckeeper/daily
Then create these three executable files:
** /usr/local/bin/xbps-install **:
** /usr/local/bin/xbps-remove **:
** /etc/cron.daily/01-record_manual_packages ** (note you need to install xtools to get xpkg):
And you're done.
perl
#!/usr/bin/env perl
use v5.42;
use English '$UID';
my $binary = trim((`which -a xbps-install`)[1]) or die "No deep xbps-install binary found";
system('etckeeper pre-install') or die "Couldn't execute 'etckeeper pre-install'\n" unless $UID;
!system($binary, @ARGV) or die "Couldn't execute this: $binary @ARGV\n";
!system('etckeeper post-install') or die "Couldn't execute 'etckeeper post-install'\n" unless $UID;
perl
#!/usr/bin/env perl
use v5.42;
use English '$UID';
my $binary = trim((`which -a xbps-remove`)[1]) or die "No deep xbps-remove binary found";
!system('etckeeper pre-install') or die "Couldn't execute 'etckeeper pre-install'\n" unless $UID;
!system($binary, @ARGV) or die "Couldn't execute this: $binary @ARGV\n";
!system('etckeeper post-install') or die "Couldn't execute 'etckeeper post-install'\n" unless $UID;
bash
#!/bin/sh
xpkg -m > /etc/my_list_of_manual_pkgs