Version control for Gentoo make.conf, USE flags
Introduction
I have recently implemented etckeeper and metastore to keep my Gentoo server:/etc directory under version control. Object of interest today is how to make a good git commit message regarding Gentoo’s /etc/make.conf and the long long USE flags (possibly multi-)line in there. Usually these USE flag changes happen in the process of reconfiguring some packages. I often don’t commit make.conf changes immediately and then after a few days can’t remember anymore what USE flags have changed and why to make a meaningful commit message.
app-portage/ufed
I’m using app-portage/ufed as my USE flag helper tool. ufed automatically tidies things up:
USE=”3dnow 7zip X aci acpi admin alsa amr apache2 apm autoipd avahi
bash-completion berkdb bluetooth cdda cddax cddb cdio cgi cleartype
consolekit cpudetection crypt css ctype ctypes-python curl dga dri dvb ee
(…)
xrandr xvid xvmc -arts -eds -fortran -gnome -ipv6 -kde -mikmod -oss
-pdflib -qt3 -sdl -spell -svga -tcpd”
wdiff ftw
Obviously line based diffs don’t do us much good here, since these lines can shift around arbitrarily due to a single use flag change. Enter wdiff which lets us compare USE flags one by one. Eduardo has written a nice piece how to make git wdiff alias.
Result from a recent media-video/vlc related USE flag change:
server:/etc # git wdiff make.conf
diff –git a/make.conf b/make.conf
index 79cda6c..b2b4d15 100644
— a/make.conf
+++ b/make.conf
@@ -2,28 +2,28 @@
# Contains local system settings for Portage system
# Please review ‘man make.conf’ for more information.USE=”3dnow 7zip X aci acpi admin alsa amr apache2 apm autoipd avahi
bash-completion berkdb bluetooth cdda cddax cddb cdio cgi cleartype
consolekit cpudetection crypt css ctype ctypes-python curl dga dri dvb ee
esd eu_epg faac faad fastcgi fbcon fbcondecor fbsplash ffmpeg flac gd
gnome-keyring gnutls gtk gtk2 hash httpd id3tag ieee1394 java java5 jikes
joystick json laptop lcms ldap libass libv4l2 lirc live lm_sensors lzo
matroska md5sum mdnsresponder-compat mmx mmxext mozilla msn mysql network
networkmanager nls nptl nptlonly nsplugin opencore-amr opengl pcmcia
pcsc-lite pdo php policykit postgres qt-static ruby samba sasl sensord
shout simplexml skins smp soap sound speex sqlite sse sse2 sse3
startup-notification stream subversion test-programs tetex theora
truetype-fonts tv_check tv_combiner tv_pick_cgi type1-fonts udev unicode
upnp usb utf8 v4l v4l2 vhosts webdav-serf x264 xattr xcb xcomposite
xrandr xvid xvmc -arts -eds -fortran -gnome -ipv6 -kde -mikmod -oss
-pdflib -qt3 -sdl -spell -svga -tcpd”