about summary refs log tree commit diff
path: root/xetcchanges
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-02-11 17:54:09 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2016-02-11 17:54:09 +0100
commitbef15594968f4899db673a73e89f29b5f3482714 (patch)
tree73da17991a5621fdcf7a6758fadb4268a4057a20 /xetcchanges
parentdf18374ab6c64ccf6eeeb361238c5f08935076fa (diff)
downloadxtools-bef15594968f4899db673a73e89f29b5f3482714.tar.gz
xtools-bef15594968f4899db673a73e89f29b5f3482714.tar.xz
xtools-bef15594968f4899db673a73e89f29b5f3482714.zip
add xetcchanges
Diffstat (limited to 'xetcchanges')
-rwxr-xr-xxetcchanges15
1 files changed, 15 insertions, 0 deletions
diff --git a/xetcchanges b/xetcchanges
new file mode 100755
index 0000000..f3e4935
--- /dev/null
+++ b/xetcchanges
@@ -0,0 +1,15 @@
+#!/bin/sh
+# xetcchanges - show diff of /etc against binary packages
+
+xbps-query -o '/etc/*' |
+	awk 'function q(a) { gsub("\\47", "\47\\\47\47", a); return "\47"a"\47" }
+	{
+		sub(" \\([^)]*\\)$", "")
+		sub(" -> .*$", "")
+		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))
+	}'