about summary refs log tree commit diff
path: root/xetcchanges
blob: 90eeb942ddbca6e7869f671c1212930bcd3dedf9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
# xetcchanges - show diff of /etc against binary packages

xbps-query -o ${1:-"/etc/*"} |
	awk 'function q(a) { gsub("\\47", "\47\\\47\47", a); return "\47"a"\47" }
	{
		sub(" \\([^)]*\\)$", "")
		if (sub(" -> .*$", ""))
			next
		i = index($0, ": ")
		pkg = substr($0, 1, i-1)
		file = substr($0, i+2)
		system("[ -f " q(file) " ] && " \
                       " xbps-query --cat=" q(file) " " q(pkg) \
 		       " | diff -u --label " q(pkg file) " - " q(file))
	}'