Posted:

what actually changed in a config file

When upgrading Debian system packages I'm left with lots of files with ".dpkg-old" and ".dpkg-dist" extensions in /etc. These are all a result of upgrades including newer config files, but being unable to install the new file out of respect for my local changes.

Figuring out exactly what's changed with diff can be annoying because often there are huge changes to the comments. While it is nice to have new comments, the comment changes overwhelm all the actual config file changes.

I've found that using grep -v '^#' to strip out the comments and then diff the results is great for figuring out what really changed. And the fancy bash (only?) "process substitution" syntax <( ... ) (see stackoverflow) lets you pipe the output from the two grep's into diff, without messing around with temporary files. For example:

diff <( grep -v '^#' smartd.conf) <( grep -v '^#' smartd.conf.dpkg-dist)

Comments or Questions?

Subscribe via RSS | Atom Feed